/// <summary> /// Release unmanaged and optionally managed resources. /// </summary> /// <param name="disposing">Called from Dispose method.</param> protected override void Dispose(bool disposing) { // If called from explicit call to Dispose if (disposing) { if (ChildControl != null) { try { ViewControl vc = ChildControl; ChildControl = null; CommonHelper.RemoveControlFromParent(vc); } catch { } } if (ChildView != null) { ChildView.Dispose(); ChildView = null; } } base.Dispose(disposing); }
private void CloseChildView(ChildView childView, bool hideOverlay) { if (childView != null) { childView.HideOverlayWhenClose = hideOverlay; childView.Close(); } }
private void closeAll() { int childCount = ChildCount; for (int i = 0; i < childCount; i++) { ChildView childView = (ChildView)GetChildAt(i); childView.closePopWindow(); } }
protected override void OnLayout(bool changed, int left, int top, int right, int bottom) { if (changed) { if (this.ChildView != null) { ChildView.Layout(left, top, this.ContentWidth, this.ContentHeight); } } }
public void ShowCreateWalletDialog(object dataContext) { if (_createWalletView != null && _createWalletView.IsOpen) { return; } this.ShowChildViewAsync(_createWalletView = new CreateWalletView { DataContext = dataContext }); }
public void ShowStartDialog(object dataContext) { if (_startView != null && _startView.IsOpen) { return; } this.ShowChildViewAsync(_startView = new StartView { DataContext = dataContext }); }
public void ShowRegisterDialog(object dataContext) { if (_registerView != null && _registerView.IsOpen) { return; } this.ShowChildViewAsync(_registerView = new RegisterView { DataContext = dataContext }); }
public void ShowLoginDialog(object dataContext) { if (_loginView != null && _loginView.IsOpen) { return; } this.ShowChildViewAsync(_loginView = new LoginView { DataContext = dataContext }); }
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 Task ShowUnlockDialogAsync(object dataContext) { if (_unlockView != null && _unlockView.IsOpen) { return(Task.CompletedTask); } return(this.ShowChildViewAsync(_unlockView = new UnlockView { HideOverlayWhenClose = !IsOverlayVisible(), DataContext = dataContext })); }
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(); }
public async System.Threading.Tasks.Task SwitchToPreviousViewTestAsync() { TestDatabase testDatabase = new TestDatabase(); TestDialogService testDialogService = new TestDialogService(); MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(testDatabase, testDialogService); mainWindowViewModel.ChildViewModel = mainWindowViewModel.Login; mainWindowViewModel.Login.AboutCommand.Execute(null); ChildView childView = mainWindowViewModel.ChildViewModel; childView.GoBackCommand.Execute(null); Assert.AreEqual(mainWindowViewModel.Login.GetType(), mainWindowViewModel.ChildViewModel.GetType()); }
public void setData(List <string>[] data) { if (data != null && data.Length > 0) { for (int i = 0; i < data.Length; i++) { List <string> list = data[i]; ChildView childView = new ChildView(mContext, this); LayoutParams layoutParams = new LayoutParams(0, ViewGroup.LayoutParams.WrapContent); layoutParams.Weight = 1; childView.LayoutParameters = layoutParams; childView.setData(list); childView.Tag = i; AddView(childView); } } }
public void ShowSendDialog(object dataContext, Action dialogLoaded = null) { if (_sendView != null && _sendView.IsOpen) { return; } _sendView = new FrameView { DataContext = dataContext }; if (dialogLoaded != null) { _sendView.Loaded += (sender, args) => { dialogLoaded(); } } ; this.ShowChildViewAsync(_sendView); }
public void ShowReceiveDialog(object dataContext) { if (_receiveView != null) { if (_receiveView.IsOpen) { return; } _receiveView.DataContext = dataContext; } else { _receiveView = new ReceiveView { DataContext = dataContext }; } this.ShowChildViewAsync(_receiveView); }
private static Task <TResult> OpenChildViewAsync <TResult>(ChildView view, Panel container) { var tcs = new TaskCompletionSource <TResult>(); void OnMouseDown(object sender, RoutedEventArgs args) { var elementOnTop = container.Children .OfType <UIElement>() .OrderBy(c => c.GetValue(Panel.ZIndexProperty)) .LastOrDefault(); if (elementOnTop != null && !Equals(elementOnTop, view)) { var zIndex = (int)elementOnTop.GetValue(Panel.ZIndexProperty); elementOnTop.SetCurrentValue(Panel.ZIndexProperty, zIndex - 1); view.SetCurrentValue(Panel.ZIndexProperty, zIndex); } } void OnClosed(object sender, RoutedEventArgs args) { view.ClosingFinished -= OnClosed; view.PreviewMouseDown -= OnMouseDown; container.Children.Remove(view); var parentWindow = container.TryFindParent <MetroWindow>(); if (parentWindow != null && parentWindow.IsOverlayVisible() && view.HideOverlayWhenClose) { parentWindow.HideOverlay(); } tcs.TrySetResult(view.ChildViewResult is TResult result ? result : default(TResult)); } view.PreviewMouseDown += OnMouseDown; view.ClosingFinished += OnClosed; view.IsOpen = true; return(tcs.Task); }
private static async Task <TResult> ShowChildViewInternalAsync <TResult>(ChildView view, Panel container) { await AddViewToContainerAsync(view, container); return(await OpenChildViewAsync <TResult>(view, container)); }
public static Task <TResult> ShowChildViewAsync <TResult>(this Window window, ChildView view, Panel container) { window.Dispatcher.VerifyAccess(); if (container == null) { throw new InvalidOperationException("The provided child view can not add, there is no container defined."); } if (container.Children.Contains(view)) { throw new InvalidOperationException("The provided child view is already visible in the specified window."); } return(ShowChildViewInternalAsync <TResult>(view, container)); }
public static Task ShowChildViewAsync(this Window window, ChildView view, Panel container) { return(ShowChildViewAsync <object>(window, view, container)); }
public static async Task <TResult> ShowChildViewAsync <TResult>(this MetroWindow window, ChildView view, bool overlay = true) { window.Dispatcher.VerifyAccess(); if (overlay) { await window.ShowOverlayAsync(); } var container = window.Template.FindName("PART_MetroActiveDialogContainer", window) as Grid; container = container ?? window.Template.FindName("PART_MetroInactiveDialogsContainer", window) as Grid; if (container == null) { throw new InvalidOperationException("The provided child view can not be add, there is no container defined."); } if (container.Children.Contains(view)) { throw new InvalidOperationException("The provided child view is already visible in the specified window."); } return(await ShowChildViewInternalAsync <TResult>(view, container)); }
public static Task ShowChildViewAsync(this MetroWindow window, ChildView view) { return(ShowChildViewAsync <object>(window, view)); }
public CustomPopupWindowOnDismissListener(ChildView childView) { _childView = childView; }
protected void Page_Load(object sender, EventArgs e) { //Gets the Selected User String ID = User.Identity.GetUserId(); string month; string year; if (!IsPostBack) { //Adds the months of the year to the MonthDropDown MonthBind(); //Databinds the years to YearDropDown YearDropDown.DataBind(); /*Checks if the current year is in the dropdown (They have volunteered this year) * and if not makes the starting value the bottom value (the most recent year) * */ ListItem checkYear = YearDropDown.Items.FindByText(DateTime.Now.Year.ToString()); if (checkYear != null) { YearDropDown.SelectedValue = DateTime.Now.Year.ToString(); } else { YearDropDown.SelectedIndex = YearDropDown.Items.Count - 1; } //Sets MonthDropDown to the current month MonthDropDown.SelectedValue = DateTime.Now.Month.ToString(); month = MonthDropDown.Text; year = YearDropDown.Text; //Binds the Facilitator hour table to the current date BindFacilitatorHours(month, year, ID); //Binds the Facilitator Room hour table to the current date BindFacilitatorRoomHours(month, year, ID); //Binds the Room hour table to the current date BindRoomHours(month, year, ID); //Binds the total stats table to the current date BindTotalStats(month, year, ID); monthlyHoursLabel.Text = GetMonthlyHours(month, year, ID); yearlyHoursLabel.Text = GetYearlyHours(month, year, ID); BindDonationRecieved(month, year, ID); BindDonationGiven(month, year, ID); } //Open Connection SqlConnection con = new SqlConnection { ConnectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString() }; con.Open(); //Get Facilitators string Facilitators = "SELECT (F.FirstName + ' '+ F.LastName) AS FacilitatorName FROM dbo.Facilitators AS F WHERE " + "F.Id = @CurrentUser"; SqlCommand getFacilitators = new SqlCommand(Facilitators, con); getFacilitators.Parameters.AddWithValue("@CurrentUser", ID); //Execture the querey SqlDataReader facilitatorReader = getFacilitators.ExecuteReader(); //Assign results FacView.DataSource = facilitatorReader; //Bind the data FacView.DataBind(); facilitatorReader.Close(); //Get Children string Children = "SELECT (C.FirstName + ' '+ C.LastName) AS Name, C.Grade as Grade, C.Class as Classroom FROM dbo.Children AS C WHERE " + "C.Id = @CurrentUser"; SqlCommand getChildren = new SqlCommand(Children, con); getChildren.Parameters.AddWithValue("@CurrentUser", ID); //Execute the querey SqlDataReader childrenReader = getChildren.ExecuteReader(); //Assign results ChildView.DataSource = childrenReader; //Bind the data ChildView.DataBind(); childrenReader.Close(); con.Close(); }
public OwnerView() { _childView = new ChildView(myServiceReference); }
protected void Page_Load(object sender, EventArgs args) { ChildView.DataSource = Children; ChildView.DataBind(); }