本文整理汇总了C#中MahApps.Metro.Controls.Flyout类的典型用法代码示例。如果您正苦于以下问题:C# Flyout类的具体用法?C# Flyout怎么用?C# Flyout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Flyout类属于MahApps.Metro.Controls命名空间,在下文中一共展示了Flyout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DetectTheme
private static Tuple<Theme, Accent> DetectTheme(Flyout flyout)
{
if (flyout == null)
return null;
// first look for owner
var window = flyout.TryFindParent<MetroWindow>();
var theme = window != null ? ThemeManager.DetectTheme(window) : null;
if (theme != null && theme.Item2 != null)
return theme;
// second try, look for main window
if (Application.Current != null) {
var mainWindow = Application.Current.MainWindow as MetroWindow;
theme = mainWindow != null ? ThemeManager.DetectTheme(mainWindow) : null;
if (theme != null && theme.Item2 != null)
return theme;
// oh no, now look at application resource
theme = ThemeManager.DetectTheme(Application.Current);
if (theme != null && theme.Item2 != null)
return theme;
}
return null;
}
开发者ID:stefan-schweiger,项目名称:MahApps.Metro,代码行数:25,代码来源:Flyout.cs
示例2: DetachHandlers
private void DetachHandlers(Flyout item)
{
var isOpenChanged = DependencyPropertyDescriptor.FromProperty(Flyout.IsOpenProperty, typeof(Flyout));
var themeChanged = DependencyPropertyDescriptor.FromProperty(Flyout.ThemeProperty, typeof(Flyout));
isOpenChanged.RemoveValueChanged(item, this.FlyoutStatusChanged);
themeChanged.RemoveValueChanged(item, this.FlyoutStatusChanged);
}
开发者ID:holymoo,项目名称:MahApps.Metro,代码行数:7,代码来源:FlyoutsControl.cs
示例3: InitWindow
/// <summary>
/// Initializes the control with a <see cref="MainWindow"/>. Necessary, as the <see cref="Window.GetWindow"/> method is unable to find a window for flyout controls.
/// </summary>
/// <param name="mainWindow">The <see cref="MainWindow"/>.</param>
public void InitWindow( MainWindow mainWindow )
{
this.window = mainWindow;
flyout = window.OSFlyout;
flyout.IsOpenChanged += OsFlyoutOnIsOpenChanged;
downloader = new WebClient( );
downloader.DownloadProgressChanged += ( Sender, Args ) => controller.SetProgress( Args.BytesReceived );;
downloader.DownloadFileCompleted += DownloaderOnDownloadFileCompleted;
LanguageList.SelectionChanged += ( Sender, Args ) =>
{
bool HasSelection = LanguageList.SelectedItems.Count > 0;
DownloadSubsLanguagesButton.IsEnabled = HasSelection;
};
window.SizeChanged += ( Sender, Args ) =>
{
if ( !Args.WidthChanged )
return;
this.Width = Args.NewSize.Width * 0.8;
};
}
开发者ID:Wolf-Code,项目名称:Videre,代码行数:29,代码来源:OpenSubtitlesControl.xaml.cs
示例4: FlyoutInfo
public FlyoutInfo(Flyout flyout, object content)
{
Argument.IsNotNull(() => flyout);
Argument.IsNotNull(() => content);
Flyout = flyout;
Content = content;
}
开发者ID:WildGums,项目名称:Orchestra,代码行数:8,代码来源:FlyoutInfo.cs
示例5: AboutActions
public AboutActions()
{
InitializeComponent();
Loaded += (sender, args) =>
{
NotifyOnInternalButtonClick();
parent = this.GetParentObject() as Flyout;
};
}
开发者ID:AndreyPetrov1991,项目名称:SP,代码行数:9,代码来源:AboutActions.xaml.cs
示例6: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.TaskSetup = ((MahApps.Metro.Controls.Flyout)(target));
return;
}
this._contentLoaded = true;
}
开发者ID:killnine,项目名称:FlyoutTest,代码行数:9,代码来源:MainWindow.g.cs
示例7: HideFlyout
public void HideFlyout(Flyout flyout)
{
var actualType = flyout.GetType();
var openFlyoutDetail = openFlyouts.FirstOrDefault(x => x.FlyoutType == actualType);
if (openFlyoutDetail != null)
openFlyoutDetail.IsHidden = true;
flyout.IsOpen = false;
}
开发者ID:BlythMeister,项目名称:Gallifrey,代码行数:9,代码来源:ModelHelpers.cs
示例8: AddFlyout
public void AddFlyout(string name, Type viewType, Position position, UnloadBehavior unloadBehavior = UnloadBehavior.SaveAndCloseViewModel)
{
Argument.IsNotNullOrWhitespace(() => name);
Argument.IsNotNull(() => viewType);
Log.Info("Adding flyout '{0}' with view type '{1}'", name, viewType.FullName);
var content = (UIElement) _typeFactory.CreateInstance(viewType);
var flyout = new Flyout();
flyout.Theme = FlyoutTheme.Adapt;
flyout.Position = position;
var flyoutInfo = new FlyoutInfo(flyout, content);
flyout.SetBinding(Flyout.HeaderProperty, new Binding("ViewModel.Title") {Source = content});
((ICompositeCommand) _commandManager.GetCommand("Close")).RegisterAction(() => { flyout.IsOpen = false; });
flyout.IsOpenChanged += async (sender, e) =>
{
if (!flyout.IsOpen)
{
var vmContainer = flyout.Content as IViewModelContainer;
if (vmContainer != null)
{
var vm = vmContainer.ViewModel;
if (vm != null)
{
switch (unloadBehavior)
{
case UnloadBehavior.CloseViewModel:
await vm.CloseViewModelAsync(null);
break;
case UnloadBehavior.SaveAndCloseViewModel:
await vm.SaveAndCloseViewModelAsync();
break;
case UnloadBehavior.CancelAndCloseViewModel:
await vm.CancelAndCloseViewModelAsync();
break;
default:
throw new ArgumentOutOfRangeException("unloadBehavior");
}
}
}
flyout.Content = null;
flyout.DataContext = null;
}
};
_flyouts[name] = flyoutInfo;
}
开发者ID:icygit,项目名称:Orchestra,代码行数:56,代码来源:FlyoutService.cs
示例9: AttachHandlers
private void AttachHandlers(Flyout flyout)
{
var isOpenNotifier = new PropertyChangeNotifier(flyout, Flyout.IsOpenProperty);
isOpenNotifier.ValueChanged += FlyoutStatusChanged;
flyout.IsOpenPropertyChangeNotifier = isOpenNotifier;
var themeNotifier = new PropertyChangeNotifier(flyout, Flyout.ThemeProperty);
themeNotifier.ValueChanged += FlyoutStatusChanged;
flyout.ThemePropertyChangeNotifier = themeNotifier;
}
开发者ID:Acaspita,项目名称:MahApps.Metro,代码行数:10,代码来源:FlyoutsControl.cs
示例10: UnregisterFlyout
public void UnregisterFlyout(Flyout flyout)
{
var mainWindow = Application.Current.MainWindow as MetroWindow;
if (mainWindow != null)
{
flyout.Loaded -= IsOpenBeforeLoadedWorkaround;
mainWindow.Flyouts.Remove(flyout);
}
}
开发者ID:torshy,项目名称:FileReplicator,代码行数:11,代码来源:FlyoutService.cs
示例11: HandleFlyoutStatusChange
internal void HandleFlyoutStatusChange(Flyout flyout, MetroWindow parentWindow)
{
if (flyout == null || parentWindow == null)
{
return;
}
this.ReorderZIndices(flyout);
var visibleFlyouts = this.GetFlyouts(this.Items).Where(i => i.IsOpen).OrderBy(Panel.GetZIndex);
parentWindow.HandleFlyoutStatusChange(flyout, visibleFlyouts);
}
开发者ID:Acaspita,项目名称:MahApps.Metro,代码行数:12,代码来源:FlyoutsControl.cs
示例12: CloseFlyout
public void CloseFlyout(Flyout flyout)
{
var actualType = flyout.GetType();
var openFlyoutDetail = openFlyouts.FirstOrDefault(x => x.FlyoutType == actualType);
if (openFlyoutDetail != null)
{
openFlyoutDetail.IsHidden = false;
}
flyout.IsOpen = false;
FlyoutClosedHandler(flyout, null);
}
开发者ID:BlythMeister,项目名称:Gallifrey,代码行数:12,代码来源:ModelHelpers.cs
示例13: MainWindow_Loaded
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
_dataContext.ShowDefaultCharts();
Flyouts = new FlyoutsControl();
Flyout control = new Flyout();
_lineEditorView = new ucLineEditorView(Token);
_lineEditorView.DataContext = new LineEditorViewModel(Token);
GlobalDataModel.LineEditorViewModel = _lineEditorView.DataContext as LineEditorViewModel;
control.Content = _lineEditorView;
control.Position = Position.Right;
control.Width = 195;
control.IsOpenChanged += control_IsOpenChanged;
Flyouts.Items.Add(control);
}
开发者ID:nearcoding,项目名称:GAP,代码行数:15,代码来源:MainWindow.xaml.cs
示例14: AdaptsWindowCommandsToDarkFlyout
public async Task AdaptsWindowCommandsToDarkFlyout()
{
await TestHost.SwitchToAppThread();
var window = await WindowHelpers.CreateInvisibleWindowAsync<FlyoutWindow>();
var flyout = new Flyout { Theme = FlyoutTheme.Dark };
window.Flyouts.Items.Add(flyout);
flyout.IsOpen = true;
Color expectedColor = ((SolidColorBrush)ThemeManager.GetAppTheme("BaseDark").Resources["BlackBrush"]).Color;
window.AssertWindowCommandsColor(expectedColor);
}
开发者ID:Amrykid,项目名称:MahApps.Metro,代码行数:15,代码来源:FlyoutTest.cs
示例15: SetSettingsFlyoutControl
public void SetSettingsFlyoutControl()
{
var window = Hearthstone_Deck_Tracker.API.Core.MainWindow;
var flyouts = window.Flyouts.Items;
Flyout flyout = new Flyout();
flyout.Name = "PluginSettingsFlyoutControl";
flyout.Header = "Video Game Recorder";
flyout.Content = new SettingsControl();
flyout.Position = Position.Left;
Panel.SetZIndex(flyout, 100);
flyouts.Add(flyout);
_settingsFlyout = flyout;
}
开发者ID:becelot,项目名称:HDT_VideoRecorder,代码行数:16,代码来源:PluginContainer.cs
示例16: OpenFlyout
public Task<Flyout> OpenFlyout(Flyout flyout)
{
var actualType = flyout.GetType();
var openFlyoutDetail = openFlyouts.FirstOrDefault(x => x.FlyoutType == actualType);
if (openFlyoutDetail == null)
{
flyoutsControl.Items.Add(flyout);
flyout.ClosingFinished += FlyoutClosedHandler;
openFlyoutDetail = new OpenFlyoutDetails(flyout);
openFlyouts.Add(openFlyoutDetail);
}
openFlyoutDetail.IsHidden = false;
openFlyoutDetail.Flyout.IsOpen = true;
return openFlyoutDetail.TaskCompletionSource.Task;
}
开发者ID:BlythMeister,项目名称:Gallifrey,代码行数:18,代码来源:ModelHelpers.cs
示例17: UpdateWindowCommandsForFlyout
public static void UpdateWindowCommandsForFlyout(this MetroWindow window, Flyout flyout)
{
Brush brush = null;
if (flyout.Theme == FlyoutTheme.Accent)
{
brush = (Brush)flyout.FindResource("IdealForegroundColorBrush");
}
else if (flyout.ActualTheme == Theme.Light)
{
brush = (Brush)ThemeManager.LightResource["BlackBrush"];
}
else if (flyout.ActualTheme == Theme.Dark)
{
brush = (Brush)ThemeManager.DarkResource["BlackBrush"];
}
window.ChangeAllWindowCommandsBrush(brush, flyout.Position);
}
开发者ID:rawbenny,项目名称:MahApps.Metro,代码行数:19,代码来源:MetroWindowHelpers.cs
示例18: SetSettingsFlyout
private static void SetSettingsFlyout()
{
var window = Hearthstone_Deck_Tracker.Helper.MainWindow;
var flyouts = window.Flyouts.Items;
// TODO: how to set Panel.ZIndex
Flyout settings = new Flyout();
settings.Name = "PluginSettingsFlyout";
settings.Position = Position.Left;
settings.Header = "Stats Converter Settings";
settings.Content = new Controls.PluginSettings();
flyouts.Add(settings);
_settings = settings;
}
开发者ID:mattwalden,项目名称:hdt-plugin-statsconverter,代码行数:15,代码来源:StatsConverterPlugin.cs
示例19: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.flyPackages = ((MahApps.Metro.Controls.Flyout)(target));
return;
case 2:
this.lstPackages = ((System.Windows.Controls.ListBox)(target));
#line 13 "..\..\MainWindow.xaml"
this.lstPackages.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.lstPackages_SelectionChanged);
#line default
#line hidden
return;
case 3:
this.btnBrowse = ((System.Windows.Controls.Button)(target));
#line 19 "..\..\MainWindow.xaml"
this.btnBrowse.Click += new System.Windows.RoutedEventHandler(this.btnBrowse_Click);
#line default
#line hidden
return;
case 4:
this.tbxPath = ((System.Windows.Controls.TextBox)(target));
return;
case 5:
this.lstLog = ((System.Windows.Controls.ListBox)(target));
return;
case 6:
this.btnStart = ((System.Windows.Controls.Button)(target));
#line 23 "..\..\MainWindow.xaml"
this.btnStart.Click += new System.Windows.RoutedEventHandler(this.btnStart_Click);
#line default
#line hidden
return;
case 7:
this.lblStatus = ((System.Windows.Controls.Label)(target));
return;
case 8:
this.barProgress = ((System.Windows.Controls.ProgressBar)(target));
return;
case 9:
this.btnChoose = ((System.Windows.Controls.Button)(target));
#line 27 "..\..\MainWindow.xaml"
this.btnChoose.Click += new System.Windows.RoutedEventHandler(this.btnChoose_Click);
#line default
#line hidden
return;
case 10:
this.tbxPackageID = ((System.Windows.Controls.TextBox)(target));
return;
}
this._contentLoaded = true;
}
开发者ID:nzambii,项目名称:MassPackageBuyer,代码行数:60,代码来源:MainWindow.g.i.cs
示例20: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.title = ((CloudManagerUI.MainWindow)(target));
return;
case 2:
this.btnAbout = ((System.Windows.Controls.Button)(target));
#line 81 "..\..\MainWindow.xaml"
this.btnAbout.Click += new System.Windows.RoutedEventHandler(this.btnAbout_Click);
#line default
#line hidden
return;
case 3:
this.Flyout = ((MahApps.Metro.Controls.Flyout)(target));
return;
case 4:
this.GoogleDriveHeading = ((System.Windows.Controls.TextBlock)(target));
return;
case 5:
this.DropboxHeading = ((System.Windows.Controls.TextBlock)(target));
return;
case 6:
this.OneDriveHeading = ((System.Windows.Controls.TextBlock)(target));
return;
case 7:
this.Status = ((System.Windows.Controls.Primitives.StatusBar)(target));
return;
}
this._contentLoaded = true;
}
开发者ID:carlilord,项目名称:CloudStorageManager,代码行数:33,代码来源:MainWindow.g.i.cs
注:本文中的MahApps.Metro.Controls.Flyout类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论