internal UserConfigurationTile ( MmasfContext context, UserConfiguration configuration, Selection <UserConfiguration> selection, int index, ContextView parent) { Context = context; Configuration = configuration; Parent = parent; var data = Configuration.CreateTileView(Configuration.GetIndicatorColor()); var frame = new Label { Opacity = 0, Background = Brushes.Yellow }; var result = new Grid(); result.Children.Add(data); result.Children.Add(frame); selection.Add ( index, Configuration, Selection.List(this, Selection.ViewByOpacity(frame)) ); ContextMenu = CreateContextMenu(); Content = result; }
internal static ScrollViewer CreateView (this MmasfContext context, Selection <UserConfiguration> selection, ContextView parent) { var result = new ScrollViewer(); var panel = new StackPanel(); var elements = context .UserConfigurations .Select ( (configuration, index) => (UIElement) new UserConfigurationTile ( context, configuration, selection, index, parent ) ); foreach (var configuration in elements) { panel.Children.Add(configuration); } result.Content = panel; result.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; return(result); }
void ShowContextView() { ContextView = new ContextView(); var main = new Window { Content = ContextView, Title = "MmasfContext" }; ContextView.Selection.RegisterKeyboardHandler(main); var configFileName = MmasfContext.Instance.SystemConfiguration.ProgramFolder.PathCombine("Main").FullName; main.InstallPositionPersister(configFileName); main.InstallMainMenu(CreateMainMenu()); CommandManager[this] = true; main.Show(); }