public void OpenWindow(WindowViewModel viewModel) { var window = WPFPageHelper.InstantiateWindow(viewModel); window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Show(); }
public IBindableWindow OpenWindow <WindowViewModelType>(Action <IDataBundle> inflateBundle = null) where WindowViewModelType : WindowViewModel, new() { var viewModel = new WindowViewModelType(); PassDataIfNeeded(viewModel, inflateBundle); var window = WPFPageHelper.InstantiateWindow(viewModel); window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Show(); return(window); }
public object CreateView(string prefix, string name) { switch (prefix) { case "element": return(WPFPageHelper.InstantiateControl(name)); case "window": return(WPFPageHelper.InstantiateWindow(name)); case "page": return(WPFPageHelper.InstantiatePage(name)); default: return(WPFPageHelper.InstantiateView(prefix, name)); } }
void OnContentChanged() { var content = Frame.NavigationPanel.CurrentContentViewModel; if (content == null) { SetupDefaultBackground(); return; } var name = $"Background_{content.GetName()}"; if (WPFPageHelper.TryGetImagePath(name, out string path)) { ChangeTo(path); } else { SetupDefaultBackground(); } }
protected override void OnStartup(StartupEventArgs e) { StaticClasses.Soulstorm.PathFinder.Find(); if (Environment.Is64BitProcess) { File.Copy(Path.Combine(Environment.CurrentDirectory, "steam_api64.dll"), Path.Combine(Environment.CurrentDirectory, "steam_api_th.dll"), true); } else { File.Copy(Path.Combine(Environment.CurrentDirectory, "steam_api86.dll"), Path.Combine(Environment.CurrentDirectory, "steam_api_th.dll"), true); } base.OnStartup(e); CoreContext.SteamApi.Initialize(); var window = WPFPageHelper.InstantiateWindow <MainWindowViewModel>(); window.Show(); MainWindow = window; }