private void CreateFeatureRows() { int i = 0; Board.RowDefinitions.Clear(); LeftHeader.RowDefinitions.Clear(); foreach (var feature in VisibleFeatures) { Board.RowDefinitions.Add(new RowDefinition { Height = new GridLength(300) }); LeftHeader.RowDefinitions.Add(new RowDefinition { Height = new GridLength(300) }); var headerView = new HeaderView(feature, Orientation.Vertical); headerView.RequestEdit += (h) => EditEntity(h as Feature); headerView.RequestRemove += (h) => RemoveEntity(h as Feature); LeftHeader.InsertAt(headerView, 0, i); i++; } }
/// <summary> /// Przekazanie contextu oraz przypisanie metod do przycisków /// </summary> /// <param name="context"></param> public MainWindowViewModel(ITerminalContext context) { Ensure.ParamNotNull(context, nameof(context)); Context = context; CloseWindow = new BasicCommand(CloseClick); MinimizeWindow = new BasicCommand(MinimizeClicked); RestoreWindow = new BasicCommand(RestoreClick); LeftHeader = new LeftHeader(" " + context.UserAccount.FirstName + " " + context.UserAccount.LastName); RestoreOnWindowSnap = new BasicCommand(WindowSnap); RestoreButtonContent = mRestoreButtonState.Restore.GetDescription(); }