示例#1
0
        private void SetSkin(object parameter, SkinButton button)
        {
            var context = parameter as ContentEditorContext;

            if (context == null)
            {
                return;
            }

            var contentModel = context.ContentEditor.ContentModel;

            if (contentModel.IsEmpty)
            {
                return;
            }

            var skinName = button.Tag as string;

            if (skinName == null)
            {
                return;
            }

            var options = AppHost.Settings.Options;

            options.Skin = skinName;
            options.Save();

            context.ContentEditor.Refresh();
        }
示例#2
0
        private void LoadViewGallery(InRibbonGallery gallery)
        {
            var renderings = new List <SkinButton>();

            foreach (var item in SkinManager.Types)
            {
                var button = new SkinButton
                {
                    Label = item.Key,
                    Tag   = item.Key
                };

                renderings.Add(button);
            }

            renderings = renderings.OrderBy(i => i.Label).ToList();

            gallery.ItemsSource = renderings;
        }