private void repositoryItemButtonEditSource_ButtonClick(object sender, ButtonPressedEventArgs e) { var childVIew = ChildViews.ElementAt(GridViewChildViews.FocusedRowHandle).ChildView as IPropertiesProvider; if (childVIew != null) { var form = new PropertiesForm(); var validationRules = childVIew.GetValidationRules(); form.SetValidationRules(validationRules); var propertyEditors = childVIew.GetPropertyEditors(); form.SetPropertyEditors(propertyEditors); var simpleProperties = childVIew.GetSimpleProperties(); form.SetSimpleProperties(simpleProperties); var collectionProperties = childVIew.GetCollections(); form.SetCollectionProperties(collectionProperties); if (form.ShowDialog() == DialogResult.OK) { childVIew.ApplySimpleProperties(); childVIew.ApplyCollections(); GridViewChildViews.HideEditor(); GridViewChildViews.RefreshData(); } else { form.RevertChanges(); } } }
/// <summary> /// Navigated event from NavigationService /// </summary> /// <param name="sender">sender</param> /// <param name="e">args</param> private void NavigationServiceNavigated(object sender, RegionNavigationEventArgs e) { string pathToMatch = e.Uri.ToString(); IsSelected = IsClassNameAMatch(pathToMatch, ViewType) || ChildViews.Any(x => IsClassNameAMatch(pathToMatch, x)); }
public void AddChild(Models.UI.IChildView child) { if (!ChildViews.Contains(child)) { ChildViews.Add(child); } }
private void DeleteChildViewButtonClick(object sender, EventArgs e) { if (GridViewChildViews.FocusedRowHandle >= 0) { ChildViews.RemoveAt(GridViewChildViews.FocusedRowHandle); GridViewChildViews.RefreshData(); } }
public MainViewModel() { ChildViews.Add(new DocumentViewModel("Document1", "/Images/change.png")); ChildViews.Add(new DocumentViewModel("Document2", "/Images/create.png")); ChildViews.Add(new DocumentViewModel("Document2", "/Images/new-16x16.png")); ChildViews.Add(new PanelViewModel(Colors.Red)); ChildViews.Add(new PanelViewModel(Colors.Blue)); ChildViews.Add(new PanelViewModel(Colors.Green)); }
public void RemoveAllConstraints() { foreach (var cv in ChildViews.ToList()) { this.RemoveView(cv); cv.Dispose(); } this.fluentEngine.RemoveAllConstraints(); }
public MainViewModel() { ChildViews.Add(new DocumentViewModel("Document1", "/Images/change.png")); ChildViews.Add(new DocumentViewModel("Document2", "/Images/create.png")); ChildViews.Add(new DocumentViewModel("Document2", "/Images/new-16x16.png")); ChildViews.Add(new PanelViewModel(Colors.Red, "1")); ChildViews.Add(new PanelViewModel(Colors.Blue, "2")); ChildViews.Add(new PanelViewModel(Colors.Green, "3")); ChildViews.Add(new AutoHideViewModel("Properties")); ChildViews.Add(new AutoHideViewModel("Messages")); }
private void OpenDialogExecute() { var child = new DocumentPanel { Content = new Dialog(), ClosingBehavior = ClosingBehavior.ImmediatelyRemove, Tag = "DocumentHost" }; ChildViews.Add(child); }
private void AddChildViewButtonClick(object sender, EventArgs e) { var childViewObject = new ChildViewObject(); ChildViews.Add(childViewObject); var childView = new ChildView(); childViewObject.ChildView = childView; childView.ObjectInspector = ObjectInspector; GridViewChildViews.RefreshData(); }
public void ProcessJson(dynamic childViews) { ChildViews.Clear(); foreach (var source in childViews) { var viewObject = new ChildViewObject(); var childView = new ChildView(); childView.ObjectInspector = ObjectInspector; childView.LoadProperties(source); viewObject.ChildView = childView; ChildViews.Add(viewObject); } GridViewChildViews.RefreshData(); }
/// <summary> /// Checks if the view can be closed /// </summary> /// <returns>True if the view can be closed, False otherwise</returns> public virtual bool CanClose() { // ask own model first if (Model != null && !Model.CanClose()) { return(false); } // ask any child views next if (ChildViews.Any(v => !v.CanClose())) { return(false); } return(true); // all good }
public DraftLeagueViewModel(GameCore core, League league) : base(core) { this.league = league; var draftLotteryVm = new DraftLotteryViewModel(core, league); draftLotteryVm.DraftLotteryComplete += () => { var draftedPlayers = core.GameState.Leagues.SelectMany(l => l.Teams.SelectMany(t => t.DraftCards.Select(d => d.Player))); var playerDraftVm = new PlayerDraftMasterViewModel(core, league, player => !draftedPlayers.Any(draftedPlayer => draftedPlayer != null && draftedPlayer.ID == player.ID)); ChildViews.Add(playerDraftVm); NotifyPropertyChanged("ChildViews"); }; ChildViews.Add(draftLotteryVm); }
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec) { var parentWidth = MeasureSpec.GetSize(widthMeasureSpec); //var sw = new System.Diagnostics.Stopwatch(); //sw.Start(); var goneViews = ChildViews.Where(v => v.Visibility == ViewStates.Gone); var textFieldsWithNoText = RealTextViews.Where(tv => string.IsNullOrEmpty(tv.Text)); fluentEngine.SetGoneViews(goneViews.Union(textFieldsWithNoText)); fluentEngine.MeasureHeight(this, parentWidth); //var measureFirstStep = sw.Elapsed; sw.Restart (); MeasureChildViews(); //var measureSecondStep = sw.Elapsed; sw.Restart (); this.SetMeasuredDimension(parentWidth, (int)fluentEngine.MeasureHeight(this, parentWidth)); //sw.Stop(); //System.Diagnostics.Debug.WriteLine("OnMeasure elapsed time first step {0}, second step {1}, SetMeasuredDimensions {2}", measureFirstStep.TotalMilliseconds, measureSecondStep.TotalMilliseconds, sw.Elapsed.TotalMilliseconds); }