Exemple #1
0
        private MainWindow(Builder builder)
            : base(builder.GetObject("MainWindow").Handle)
        {
            // custom css
            var provider = new CssProvider();

            provider.LoadFromPath("Assets/app.css");
            Gtk.StyleContext.AddProviderForScreen(Gdk.Screen.Default, provider, 800);

            // window views
            var controlsViewModel = new ControlsViewModel(this);
            var aboutViewModel    = new AboutViewModel(this);

            builder.Autoconnect(this);
            builder.Autoconnect(controlsViewModel);

            // events
            DeleteEvent += Window_DeleteEvent;

            // menu events
            _button_menu_control.Clicked += ButtonMenuControlClicked;
            _button_menu_about.Clicked   += ButtonMenuAboutClicked;

            controlsViewModel.Init();
            aboutViewModel.Init();
        }
Exemple #2
0
 /// <summary>
 /// 初始化
 /// </summary>
 internal void Init()
 {
     viewModel.Init();
     DisableCount      = 0;
     DisableAlertCount = 0;
 }
 protected async override void OnAppearing()
 {
     base.OnAppearing();
     await model.Init();
 }