// There's not supposed to be any logic in the view, so I'd move most of the methods in here to a controller public LoginScreen(MainFrame mainFrame) { this.MainFrame = mainFrame; InitializeComponent(); _controller = new LoginController(mainFrame, this); }
public LoginController(MainFrame mainFrame, LoginScreen screen) { this._screen = screen; _dbc = DatabaseController.Instance; this.MainFrame = mainFrame; }
public LoginScreen(MainFrame mainFrame) // There's not supposed to be any logic in the view, so I'd move most of the methods in here to a controller { this.MainFrame = mainFrame; InitializeComponent(); _controller = new LoginController(mainFrame, this); }
/// <summary> /// Contructor for the More-Options-Window class. /// Initalizes context and the main frame object. /// Calls the InitializeComponent method. /// Calls the fillPlacedObjectListFromContext method, /// to list the values of the plcable object, /// wich are allready placed. /// </summary> /// <param name="mainFrame"></param> /// <param name="context"></param> public MoreOptionsWindow(MainFrame mainFrame, Context context) { this.context = context; MainFrame = mainFrame; InitializeComponent(); fillPlacedObjectListFromContext(); }
// public PlacementController(MainFrame motherFrame, ProductAdding pa) { this.motherFrame = motherFrame; productAdding = pa; clickLocation = new Point(0, 0); productAdding.productPanel.knowYourController(this); //Make an event when the selection of the ASSORTMENT or INVENTORY has changed productAdding.productList1.SelectionChanged += new ProductSelectionChanged(this.ChangeSelected); //Select the first product from the product list, and display it in the default info try { ProductInfo defaultInfo = new ProductInfo(ProductModel.List[0]); ChangeSelected(defaultInfo); } catch { } //Make an event that triggers when the list is changed, so that it automatically repaints the screen. placedProductList.CollectionChanged += ppList_CollectionChanged; //TEMP //Fill the staticlyplaced list with walls Vector pointTopLeft = new Vector(0, 0); Vector pointTopRight = new Vector(productAdding.productPanel.Width - 1, 0); Vector pointBottomLeft = new Vector(0, productAdding.productPanel.Height - 1); Vector pointBottomRight = new Vector(productAdding.productPanel.Width - 1, productAdding.productPanel.Height - 1); staticlyPlacedObjectList = new List<PlacedProduct>(); int length = (int)(pointBottomRight.Y - pointTopRight.Y); int width = (int)(pointTopRight.X - pointTopLeft.X); staticlyPlacedObjectList.Add( //Top new PlacedProduct( new ProductModel(0, "", "", width, 1, 1, true), new PointF(width / 2, 0))); staticlyPlacedObjectList.Add( //Right new PlacedProduct( new ProductModel(0, "", "", 1, 1, length, true), new PointF(width, length / 2))); staticlyPlacedObjectList.Add( //Bottom new PlacedProduct( new ProductModel(0, "", "", width, 1, 1, true), new PointF(width / 2, length))); staticlyPlacedObjectList.Add( //Left new PlacedProduct( new ProductModel(0, "", "", 1, 1, length, true), new PointF(0, length / 2))); }
public SpaceChoice(MainFrame mainScreen) { this.MainScreen = mainScreen; InitializeComponent(); FillComboBox(comboBox1); Invalidate(); }
/// <summary> /// Class constructor /// </summary> /// <param name="mf">View form</param> /// <param name="uc">Controller for logged in user</param> public TracksController(MainFrame mf, UserController uc) { myViewFrame = mf; myUserController = uc; userId = myUserController.getUserId(); myTracks = new Tracks(userId); }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // On crée la mainframe mais on ne l'affichage pas encore BrickInvaders._frame = new MainFrame(); // On crée le launcher et on le lance Launcher launcher = new Launcher(); Application.Run(launcher); // On récupère la configuration qui en est issue Configuration c = launcher.Configuration; // Si elle existe (le launcher n'a pas été fermé mais on l'a validé) if (c != null) { // On crée le joueur et le modèle du jeu, on charge les scores associés, la mainframe surveillera le modèle pour détecter la défaite entre autre Player p = new Player(launcher.Pseudo); ModelInterface m = new GameModel(); m.SetScoresModel(new ScoresModel(c.GameMode)); m.AddObserver(BrickInvaders._frame); // On initialise le contrôleur Engine.Initialise(p, c, m, BrickInvaders._frame); // On lance l'application depuis la mainframe Application.Run(BrickInvaders._frame); } }
public static void Initialise(Player p, Configuration c, ModelInterface m, MainFrame form) { if (INSTANCE == null) { INSTANCE = new Engine(p, c, m, form); } }
public ConfigDlg(MainFrame main) { InitializeComponent(); _main = main; }
void LoadInitialFile(string filename) { mainFrame = new MainFrame(); controller = new Controller(mainFrame); bool success = controller.LoadInitialFile(TestUtil.GetTestFile(filename), true); Assert.IsTrue(success); // Start the UI mainFrame.Show(); }
public AssortmentScreen(MainFrame hoofdscherm) { InitializeComponent(); this.hoofdscherm = hoofdscherm; controller = new AssortmentController(this); noAmountCheckBox.Checked = true; deleteCheckBox.Checked = true; DropdownBrand.SelectedIndex = 0; DropdownCategory.SelectedIndex = 0; Invalidate(); }
private Engine(Player p, Configuration c, ModelInterface m, MainFrame form) { this._player = p; this._configuration = c; this._model = m; form.Engine = this; this._timer = new System.Timers.Timer(DEFAULT_INTERVAL); this._timer.Elapsed += new ElapsedEventHandler(OnTimedEvent); this._timer.SynchronizingObject = form; }
public InventoryScreen(MainFrame hoofdscherm ) { //create new controller for this screen this._controller = new InventoryController(this); this.Hoofdscherm = hoofdscherm; // init screen and fill all the data InitializeComponent(); _controller.FillData(); _controller.FillDropdown(); Invalidate(); }
public void SetMainFrame(MainFrame mainFrame) { this.mainFrame = mainFrame; }
public MapsScreen(MainFrame mainFrame) { this.MainFrame = mainFrame; InitializeComponent(); _controller = new MapsController(this); }
private MainFrame myViewFrame; //View #endregion Fields #region Constructors /// <summary> /// Guest user controller constructor /// </summary> /// <param name="ts">View frame</param> public UserController(MainFrame ts) { myViewFrame = ts; myUser = new User(-1); }
public MainScreen(MainFrame mainFrame) { this.MainFrame = mainFrame; InitializeComponent(); }
private void InitializeMachineInfo() { if (this.LocalInformationConfigData == null || this.LocalInformationConfigData.MachineInfos == null || this.LocalInformationConfigData.MachineInfos.Count < 1) { return; } this._machineForms = new Dictionary<string, MainFrame>(); this._machineMessageInfos = new Dictionary<string, MachineMessageInfo>(); for (int i = 0; i < this.LocalInformationConfigData.MachineInfos.Count; i++) { MachineLocalInformationConfig machineLocalInfo = this.LocalInformationConfigData.MachineInfos[i]; MainFrame frm = new MainFrame(this.LocalInformationConfigData, machineLocalInfo); frm.ScreenSize = this.LocalInformationConfigData.ScreenSize; frm.MachineMessageEvent += new EventHandler<EventBaseInfo<EventMachineMessageInfo>>(MachineMessageEvent); frm.TopLevel = false; frm.Show(); this._machineForms.Add(machineLocalInfo.MachineID, frm); } this.ShowMachineForm(this.LocalInformationConfigData.MachineInfos[0].MachineID); this.SetMachineTablePanel(); this.MachineMessageBox.RemoveMachineMessage(this.LocalInformationConfigData.MachineInfos[0].MachineID); }
void CloseMainFrame() { mainFrame.Dispose(); mainFrame = null; }
private void BtnUserConfig_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new Pages.PageUserConfig()); }
public MainWindow() { InitializeComponent(); MainFrame.Navigate(new Pages.LogIn()); }
private void UserBtn_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new UserPage()); }
private void WindowLoaded(object sender, RoutedEventArgs e) { //MainFrame.Content = new MainMenu(); MainMenu = new MainMenu(this); MainFrame.Navigate(MainMenu); }
private void GoToCrews_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(typeof(CrewView)); }
private void GoToFlights_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(typeof(FlightView)); }
private void MessageCenter_MainFrameNavigatedTo1(Type page, object par) { MainFrame.Navigate(page, par); }
private void BtnCreateNewEntry_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new FormNewEntry()); }
private void ManageUserButton_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(typeof(ManageUserPage)); }
private void HomeButton_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(typeof(LoginPage)); }
public MainPage() { this.InitializeComponent(); MainFrame.Navigate(typeof(LoginPage)); }
private void BtnSearchEntry_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new SearchEntry()); }
private void HistoryBtn_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new HistoryPage()); }
internal void Navigate(Type type) { MainFrame.Navigate(type); }
private void GoToDepartures_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(typeof(DepartureView)); }
private void GoToPlanes_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(typeof(PlaneView)); }
public MainUnitPage() { InitializeComponent(); MainFrame.Navigate(new Uri("Pages/Units.xaml", UriKind.RelativeOrAbsolute)); }
private void GoToStewardesses_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(typeof(StewardessView)); }
public MainWindow() { InitializeComponent(); MainFrame.Navigate(new Home()); }
private void usun_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new Uri("Pages/DeleteUnit.xaml", UriKind.RelativeOrAbsolute)); }
private void OwnerTable_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new OwnerTable()); }
private void StartNewGameBtn_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new Pages.GameSelectTypePage()); }
private void CardTable_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new MainPage()); }
private async void Page_Loaded(object sender, RoutedEventArgs e) { if (App.Discord == null) { return; // im not 100% sure why this gets called on logout but it does so } Analytics.TrackEvent("DiscordPage_Loaded"); try { App.Discord.MessageCreated += Notification_MessageCreated; UpdateTitleBar(); CheckSettingsPane(); _loaded = true; this.FindParent <MainPage>().HideConnectingOverlay(); var service = DiscordNavigationService.GetForCurrentView(); if (_args != null && _args.ChannelId != 0 && App.Discord.TryGetCachedChannel(_args.ChannelId, out var channel)) { Analytics.TrackEvent("DiscordPage_NavigateToSpecifiedChannel"); await service.NavigateAsync(channel); } else { Analytics.TrackEvent("DiscordPage_NavigateToFriendsPage"); Model.IsFriendsSelected = true; SidebarFrame.Navigate(typeof(DMChannelsPage)); MainFrame.Navigate(typeof(FriendsPage)); } if (_args?.ThemeLoadException != null) { Analytics.TrackEvent("DiscordPage_ThemeErrorMessageShown"); var message = App.Discord.CreateMockMessage( $"We had some trouble loading your selected themes, so we disabled them for this launch. For more information, see settings.", App.Discord.CreateMockUser("Unicord", "CORD")); ShowNotification(message); } var notificationService = BackgroundNotificationService.GetForCurrentView(); await notificationService.StartupAsync(); var possibleConnection = await VoiceConnectionModel.FindExistingConnectionAsync(); if (possibleConnection != null) { (DataContext as DiscordPageModel).VoiceModel = possibleConnection; } await ContactListManager.UpdateContactsListAsync(); } catch (Exception ex) { Logger.LogError(ex); await UIUtilities.ShowErrorDialogAsync("An error has occured.", ex.Message); } }
public MainWindow() { this.InitializeComponent(); MainFrame.Navigate(typeof(FirstPage)); }
internal void Navigate(Type type, object parameter) { MainFrame.Navigate(type, parameter); }
private async void NavView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args) { if (args.IsSettingsInvoked) { MainFrame.Navigate(typeof(Views.SettingPage)); //Utils.ShowMessageToast("你选择了设置"); return; } var item = args.InvokedItemContainer.Tag as MenuModel; switch (item.openMode) { case MenuOpenMode.Home: MainFrame.Navigate(typeof(Views.HomePage), item.parameters); break; case MenuOpenMode.Search: MainFrame.Navigate(typeof(Views.SearchPage)); break; case MenuOpenMode.Download: break; case MenuOpenMode.LoaclMusic: break; case MenuOpenMode.Collection: break; case MenuOpenMode.Attention: break; case MenuOpenMode.Songlist: MainFrame.Navigate(typeof(Views.SonglistPage), item.parameters); break; case MenuOpenMode.Song: break; case MenuOpenMode.User: MainFrame.Navigate(typeof(Views.SingerPage), item.parameters); break; case MenuOpenMode.Webpage: break; case MenuOpenMode.Account: MainFrame.Navigate(typeof(Views.UserPage)); break; case MenuOpenMode.Rank: MainFrame.Navigate(typeof(Views.RankPage)); break; case MenuOpenMode.Radio: break; case MenuOpenMode.Login: await Utils.ShowLoginDialog(); break; case MenuOpenMode.MyCollect: break; case MenuOpenMode.MyAttention: break; default: break; } }
private void BtnHome_Click(object sender, RoutedEventArgs e) { MainFrame.Navigate(new Home()); }