/// <summary> /// Marks the specified view as active. /// </summary> /// <param name="view">The view to activate.</param> /// <remarks>If there is an active view before calling this method, /// that view will be deactivated automatically.</remarks> public override void Activate(object view) { var currentActiveView = ActiveViews.FirstOrDefault(); if (currentActiveView != null && currentActiveView != view && Views.Contains(currentActiveView)) { base.Deactivate(currentActiveView); } base.Activate(view); }
/// <inheritdoc /> public async Task AddView(ISchedulerView view) { if (!Views.Contains(view)) { Views.Add(view); if (SelectedView == view) { await InvokeLoadData(); } StateHasChanged(); } }
string GetViewName() { lock (Views) { while (true) { string name = string.Format("view_{0}", PRNG.Next()); if (!Views.Contains(name)) { Views.Add(name); return(name); } } } }
public IMXView[] PopToView(IMXView view) { if (view == null) { return(null); } if (!Views.Contains(view)) { throw new ArgumentException(); } var removed = new List <IMXView>(); var layer = CurrentLayer; // Perform pop on Views collection IMXView current; while (!Equals(current = _views.LastOrDefault(), view)) { _views.Remove(current); var d = current is IListView?CompactFactory.GetNativeObject <SmoothListbox>(current, "view") : null; if (d != null) { d.Parent = null; d.animationTimer.Enabled = false; d.Dispose(); } removed.Add(current); } if (removed.Count <= 0) { return(removed.ToArray()); } Align(NavigationType.Back); if (layer != null) { layer.Unload(); } var iview = removed.First() as IView; iview.RaiseEvent("Deactivated", EventArgs.Empty); return(removed.ToArray()); }
public bool ViewsAddOrDel(string img) { if (Views == null) { Views = new List <string>(); } if (Views.Contains(img)) { Views.Remove(img); return(false); } else { Views.Add(img); return(true); } }