Replies: 6 comments 3 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I don't think I follow. |
Beta Was this translation helpful? Give feedback.
-
So I have a Window Form I named CustomerConsole has a ContentControl, In customerconsole I select a customer and a usercontrol is opened in the window's contentcontrol, In this case the usercontrol is name CustomerPrograms.. This first usercontrol, CustomerPrograms also has a contentcontrol into which I open a form for CRUD operations depending on the operation. The first user control has a datagrid that i want to refresh when I return from the CRUD operation. The second user control is named CreateCustomerProgram. I put a break point at LoadComboBoxes() in CustomerPrams which is the first line following this.ActivateItem(SubCurrentPage); but I never hit the break point.
I'm wondering if it's because I've got a form displaying in a contentcontrol which is also in a content control. so it's like a child contentcontrol
On Thursday, December 17, 2020, 04:14:04 AM EST, Antony Male <notifications@github.com> wrote:
I don't think I follow. ActivateItem returns straight away -- it adds that item to the conductor's children (or replaces the current child, depending on the type of the conductor), and then returns. It's not like IWindowManager.ShowMessageBox, which only returns when the message box is closed. Are you sure that our breakpoint on LoadComboBoxes isn't hit straight after ActivateItem is executed?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
Hi,I've attached a zip file that has a stripped down project. I've commented out all the DB stuff, properties etc. It should be evident where to go as I've disabled unnecessary buttons. I put a break point in CustomerProgramsViewModel in the method AddProgram() where I would expect things to return after performing the add or cancelling out of the add. It doesn't hit that breakpoint after doing either the add or cancel.
I'm either doing something wrong or I misunderstand what is supposed to happen. If you could point me in the right direction I would really appreciate it.
Charlie
On Saturday, December 19, 2020, 11:47:28 AM EST, Antony Male <notifications@github.com> wrote:
If you just want to be told when a Conductor's child is closed, you can subscribe to PropertyChanged and see when ActiveItem becomes null, for example:
public CustomerConsole()
{
this.Bind(s => s.ActiveItem, (o, e) =>
{
if (e.NewValue == null)
{
// The ActiveItem was closed: refresh the DataGrid
}
});
}
There are also various virtual methods on Conductor which you can override if you wish.
However, you haven't shared enough code for me to give a concrete suggestion.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
Hi,I reread your last response and that works.
thanks for your help. Disregard my last email
Charlie
On Saturday, December 19, 2020, 11:47:28 AM EST, Antony Male <notifications@github.com> wrote:
If you just want to be told when a Conductor's child is closed, you can subscribe to PropertyChanged and see when ActiveItem becomes null, for example:
public CustomerConsole()
{
this.Bind(s => s.ActiveItem, (o, e) =>
{
if (e.NewValue == null)
{
// The ActiveItem was closed: refresh the DataGrid
}
});
}
There are also various virtual methods on Conductor which you can override if you wish.
However, you haven't shared enough code for me to give a concrete suggestion.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
Glad it's working for you |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a window form that has a DataGrid. At the bottom of the form I have a contentcontrol which I use to display user controls depending on need.
I'm opening the the user control in the following manner
What I want is to have happen is for the DataGrid refreshed following a CRUD operation.
Everything works fine with the exception of the two methods following the this.ActivateItem. When I close the user control with this.RequestClose(), the user control closes but LoadComboBoxes(); and LoadProgramGrid(); are not executed in the initiating window form following the usercontrol close. When I put a breakpoint after the activateitem the flow never brings me back to the first line following the activateitem.
Is there a better way of either initiating a user control or closing the usercontrol so that I go back to the intitating method and pickup with the line following the activateitem?
Chanks,
Charlie
Beta Was this translation helpful? Give feedback.
All reactions