Exemple #1
0
        /// <inheritdoc />
        public void Startup()
        {
            // Override the ConfigView with a much nicer looking version
            ViewLocator.NameTransformer.AddRule(@"^Application\.Demo\.UseCases\.Configuration\.ViewModels\.ConfigViewModel$", "Application.Demo.MetroAddon.Views.ConfigView");
            var demoResources = new Uri("pack://application:,,,/Application.Demo;component/DemoResourceDirectory.xaml", UriKind.RelativeOrAbsolute);

            _resourceManager.AddResourceDictionary(demoResources);
        }
Exemple #2
0
        /// <summary>
        /// Do the initialization
        /// </summary>
        private void InitializeTrayIconViewModels()
        {
            // Load the TrayIconResourceDirectory.xaml for the look & feel
            var trayIconResourceDirectory = new Uri("pack://application:,,,/Dapplo.CaliburnMicro.NotifyIconWpf;component/TrayIconResourceDirectory.xaml", UriKind.RelativeOrAbsolute);

            _resourceManager.AddResourceDictionary(trayIconResourceDirectory, 1);

            foreach (var trayIconViewModel in _trayIconViewModels.Select(x => x.Value))
            {
                // Get the view, to store it as ITrayIcon
                trayIconViewModel.ViewAttached += (sender, viewAttachedEventArgs) =>
                {
                    var trayIcon = viewAttachedEventArgs.View as ITrayIcon;
                    _trayIcons.Add(new WeakReference <ITrayIconViewModel>(trayIconViewModel), new WeakReference <ITrayIcon>(trayIcon));
                };
                _windowsManager.ShowPopup(trayIconViewModel);
            }
        }
        /// <summary>
        ///     Add a ResourceDictionary for the specified MahApps style
        ///     The Uri to the source is created by CreateMahappStyleUri
        /// </summary>
        /// <param name="style">
        ///     Style name, this is actually what is added behind
        ///     pack://application:,,,/MahApps.Metro;component/Styles/ (and .xaml is added)
        /// </param>
        /// <param name="order">int order for the ResourceManager</param>
        public void AddMahappsStyle(string style, int order = 0)
        {
            var packUri = CreateMahappStyleUri(style);

            _resourceManager.AddResourceDictionary(packUri, order);
        }
Exemple #4
0
        /// <inheritdoc />
        public void Startup()
        {
            var pipResourceDirectory = new Uri("pack://application:,,,/Pip;component/PipResourceDirectory.xaml", UriKind.RelativeOrAbsolute);

            _resourceManager.AddResourceDictionary(pipResourceDirectory);
        }