public ConfigImplementationSelectorItem( ConfigManager configManager, PluginCluster pluginCluster )
     : base(configManager)
 {
     _cluster = pluginCluster;
     SelectItem = new VMCommand( OnSelectItem, CanSelectItem );
     OpenEditor = new VMCommand( StartPluginEditor, () => CanOpenEditor );
 }
        public NewerVersionViewModel( string releasenotes, string newVersion, Action<bool> CloseView, Action<string> SetBrowserContent )
        {
            Title = R.UpdateAvailableTitle;

            OkCommand = new VMCommand( () => CloseView( true ) );
            CancelCommand = new VMCommand( () => CloseView( false ) );

            Header = string.Format( R.UpdateAvailableContent, newVersion );

            if( !string.IsNullOrEmpty( releasenotes ) )
            {
                string cssSnipet = string.Empty;
                using( var rs = typeof( NewerVersionViewModel ).Assembly.GetManifestResourceStream( "UpdateChecker.View.Resources.MarkdownCssSnipet.html" ) )
                using( var rdr = new StreamReader( rs ) )
                    cssSnipet = rdr.ReadToEnd();

                ReleaseNotes = string.Concat( cssSnipet, new Markdown( new MarkdownOptions { AutoHyperlink = false } ).Transform( releasenotes ) );

                SetBrowserContent( ReleaseNotes );
            }
        }
예제 #3
0
        public VMKeyEditable( VMContextEditable ctx, IKey k )
            : base(ctx)
        {
            //By default, we show the fallback.
            ShowFallback = FallbackVisibility.FallbackOnLayout | FallbackVisibility.FallbackOnKeyMode;

            _context = ctx;
            _key = k;

            _actionsOnPropertiesChanged = new Dictionary<string, ActionSequence>();

            _context = ctx;
            KeyDownCommand = new CK.Windows.App.VMCommand( () => _context.SelectedElement = this );
            _currentKeyModeModeVM = new VMKeyboardMode( _context, k.Current.Mode );
            _currentLayoutKeyModeModeVM = new VMKeyboardMode( _context, k.CurrentLayout.Current.Mode );

            _layoutKeyModes = new ObservableCollection<VMLayoutKeyModeEditable>();
            _keyModes = new ObservableCollection<VMKeyModeEditable>();

            RefreshKeyModeCollection();
            RefreshLayoutKeyModeCollection();

            GetImageSourceCache();

            RegisterEvents();
        }