Inheritance: ReactiveUI.ReactiveObject, IAppBootstrapper
Exemplo n.º 1
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ViewModel = new AppBootstrapper();

            // XXX: ReactiveUI Bug
            viewHost.Router = (RoutingState)ViewModel.Router;
        }
Exemplo n.º 2
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     DataContext = new AppBootstrapper();
 }
Exemplo n.º 3
-1
        public MainWindow()
        {
            InitializeComponent();

            AppBootstrapper = new AppBootstrapper();
            DataContext = AppBootstrapper;

            UpdateDwmBorder();

            taskbarIcon = new TaskbarIcon();

            MessageBus.Current.Listen<bool>("IsPlaying").Subscribe(x => {
                taskbarIcon.IconSource = x ?
                   new BitmapImage(new Uri("pack://application:,,,/Play;component/Images/status-icon-on.ico")) :
                   new BitmapImage(new Uri("pack://application:,,,/Play;component/Images/status-icon-off.ico"));

                taskbarIcon.Visibility = Visibility.Visible;
            });

            taskbarIcon.LeftClickCommand = ReactiveCommand.Create(_ => true, _ => {
                if (WindowState == WindowState.Minimized) {
                    WindowState = WindowState.Normal;
                }

                Show();
            });
        }