本文整理汇总了C#中MahApps.Metro.Controls.MetroWindow类的典型用法代码示例。如果您正苦于以下问题:C# MetroWindow类的具体用法?C# MetroWindow怎么用?C# MetroWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MetroWindow类属于MahApps.Metro.Controls命名空间,在下文中一共展示了MetroWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnsureWindow
protected override Window EnsureWindow(object model, object view, bool isDialog)
{
var window = view as MetroWindow;
if (window == null)
{
window = new MetroWindow { Content = view, };
window.SetValue(View.IsGeneratedProperty, true);
window.Resources.MergedDictionaries.Add(this.themeManager.GetThemeResources());
var owner = this.InferOwnerOf(window);
if (owner != null)
{
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
window.ShowInTaskbar = false;
window.Owner = owner;
}
else
{
window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
}
}
else
{
var owner2 = this.InferOwnerOf(window);
if (owner2 != null && isDialog)
{
window.ShowInTaskbar = false;
window.Owner = owner2;
}
}
return window;
}
示例2: Execute
public async Task<object> Execute( MetroWindow window, object args )
{
Window = window;
Csa = args as ConfirmationServiceArgs;
Debug.Assert( Csa != null, "Csa != null" );
Dialog = new ConfirmDialog();
Tcs = new TaskCompletionSource<bool?>();
Vm = Dialog.DataContext as ConfirmDialogViewModel;
Debug.Assert( Vm != null, "Vm != null" );
Vm.Reset();
Vm.AffirmativeText = Csa.AffirmativeText;
Vm.NegativeText = Csa.NegativeText;
Vm.Title = Csa.Title;
Vm.Message = Csa.Message;
Vm.DisplayDontAskAgain = Csa.DisplayDontAskAgain;
Vm.CloseRequested += Vm_CloseRequested;
await window.ShowMetroDialogAsync( Dialog );
return await Tcs.Task;
}
示例3: Navigate
public static void Navigate(string text, MetroWindow currentWindow, TargetWindow targetWindow)
{
var tagInfo = text;
var tWindow = GetTargetWindowRef(targetWindow);
tWindow.Show();
currentWindow.Hide();
}
示例4: SimulationSettingsControl
public SimulationSettingsControl(MetroWindow containingWindow, SimulationSettings settings, FMTesterConfiguration configuration, ExecutionInstance instance, ExecutionEnvironment environment)
{
InitializeComponent();
this.containingWindow = containingWindow;
this.ModelSimulationSettings = settings;
this.configuration = configuration;
this.instance = instance;
this.environment = environment;
if (settings != null)
{
ModelSimulationTimeNumUpDown.Value = settings.ModelSimulationTime as double?;
DesiredValueReachedNumUpDown.Value = settings.StableStartTime as double?;
SmoothnessStartDifferenceNumUpDown.Value = settings.SmoothnessStartDifference as double?;
ResponsivenessCloseNumUpDown.Value = settings.ResponsivenessClose as double?;
DesiredValueNameTextBox.Text = settings.DesiredVariable.Name;
DesiredValueFromNumUpDown.Value = Decimal.ToDouble(settings.DesiredVariable.FromValue) as double?;
DesiredValueToNumUpDown.Value = Decimal.ToDouble(settings.DesiredVariable.ToValue) as double?;
ActualValueNameTextBox.Text = settings.ActualVariable.Name;
ActualValueFromNumUpDown.Value = Decimal.ToDouble(settings.ActualVariable.FromValue) as double?;
ActualValueToNumUpDown.Value = Decimal.ToDouble(settings.ActualVariable.ToValue) as double?;
DisturbanceValueNameTextBox.Text = settings.DisturbanceVariable.Name;
DisturbanceValueToNumUpDown.Value = Decimal.ToDouble(settings.DisturbanceVariable.ToValue) as double?;
}
}
示例5: CameraPositioningCalibrationView
public CameraPositioningCalibrationView(MetroWindow parentWindow, MetroDialogSettings settings)
: base(parentWindow, settings)
{
InitializeComponent();
DataContextChanged += CameraPositioningCalibrationView_DataContextChanged;
CloseButton.Command = CloseCommand;
}
示例6: ShowMessage
public static async Task<MessageDialogResult> ShowMessage(MetroWindow Wnd, string message, MessageDialogStyle dialogStyle)
{
var metroWindow = Wnd as MetroWindow;
metroWindow.MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Accented;
return await metroWindow.ShowMessageAsync("Atenção", message, dialogStyle, metroWindow.MetroDialogOptions);
}
示例7: CalibrateMagnetometer
public async void CalibrateMagnetometer(MetroWindow window)
{
var controller = await window.ShowProgressAsync("Please wait...", "Setting up Magnetometer Calibration.", true);
await Task.Delay(3000);
controller.SetTitle("Magnetometer Calibration");
for (int i = 0; i < 101; i++)
{
controller.SetProgress(i / 100.0);
controller.SetMessage(string.Format("Rotate the controller in all directions: {0}%", i));
if (controller.IsCanceled) break;
await Task.Delay(100);
}
await controller.CloseAsync();
if (controller.IsCanceled)
{
await window.ShowMessageAsync("Magnetometer Calibration", "Calibration has been cancelled.");
}
else
{
await window.ShowMessageAsync("Magnetometer Calibration", "Calibration finished successfully.");
}
}
示例8: EnsureWindow
protected override Window EnsureWindow(object model, object view, bool isDialog) {
var window = view as Window;
if (window == null) {
var metroWindow = new MetroWindow {
Content = view,
SizeToContent = SizeToContent.WidthAndHeight,
TitlebarHeight = 0
};
window = metroWindow;
//Interaction.GetBehaviors(metroWindow).Add(new GlowWindowBehavior());
metroWindow.SetValue(MoveableWindowBehavior.IsEnabledProperty, true);
metroWindow.SetValue(View.IsGeneratedProperty, true);
var owner = InferOwnerOf(window);
if (owner != null) {
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
window.Owner = owner;
} else
window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
} else {
var owner = InferOwnerOf(window);
if ((owner != null) && isDialog)
window.Owner = owner;
}
SetupRxWindow(model, view, window);
return window;
}
示例9: CameraView
/// <summary>
/// Initializes a new instance of the CameraView class.
/// </summary>
public CameraView()
{
InitializeComponent();
DataContextChanged += CameraView_DataContextChanged;
_parentWindow = (MetroWindow) Application.Current.MainWindow;
}
示例10: SwitchProfileDialog
public SwitchProfileDialog(string[] profiles, MetroWindow parentWindow, MetroDialogSettings settings)
: base(parentWindow, settings)
{
InitializeComponent();
foreach (string profile in profiles)
PART_ProfileComboBox.Items.Add(profile);
}
示例11: AddMetroResources
private void AddMetroResources(MetroWindow window)
{
_resourceDictionaries = LoadResources();
foreach (ResourceDictionary dictionary in _resourceDictionaries)
{
window.Resources.MergedDictionaries.Add(dictionary);
}
}
示例12: ShowsWindowCommandsOnTopByDefault
public async Task ShowsWindowCommandsOnTopByDefault()
{
await TestHost.SwitchToAppThread();
var window = new MetroWindow();
Assert.True(window.ShowWindowCommandsOnTop);
}
示例13: SoftContext
public SoftContext(MetroWindow window)
{
DmSystem = new DmSystem(new DmPlugin());
MainWindow = window;
HttpClient = new HttpClient();
IsLogin = false;
TaskEngine = new TaskEngine();
}
示例14: AdvancedInputDialog
internal AdvancedInputDialog(MetroWindow parentWindow, MetroDialogSettings settings)
: base(parentWindow, settings)
{
InitializeComponent();
PART_AffirmativeButton.Content = settings.AffirmativeButtonText;
PART_NegativeButton.Content = settings.NegativeButtonText;
Input = settings.DefaultText;
}
示例15: PerformanceOverview
public PerformanceOverview()
{
mainWindow = Application.Current.Windows.OfType<MetroWindow>().FirstOrDefault(x => x.Title == "Ultimate Festival Organizer");
ufoVM = (UFOCollectionVM)mainWindow.DataContext;
DataContext = ufoVM;
InitializeComponent();
initialized = true;
}