How to store open state of particular ChildWindow in a property?
up vote
0
down vote
favorite
I use ChildWindows in my project and I need to store open state of particular ChildWindow in a property, then use that property as a condition for mentioned ChildWindow calling.
First I made this snippet of code. It has its drawbacks. So I want to use another way.
private void button1_Click(object sender, RoutedEventArgs e)
{
if (ChildWindow_02_in_XAML.IsOpen == false)
{
// await this.ShowChildWindowAsync(new ChildWindow_02() { IsModal = false, AllowMove = true, }, RootGrid);
Parameter_02_in_XAML.IsOpen = true;
}
else if (Parameter_02_in_XAML.IsOpen == true)
{
Parameter_02_in_XAML.Close();
}
else
{
return;
}
}
Now I have ChildWindow as a class, and I made following stuff:
IsOpen="{Binding IschildWindow_02_Opened}"
And I'm going to use that method that is commented at the moment.
So I have a question how to process with this variable further.
c# wpf xaml visual-studio-2015 childwindow
add a comment |
up vote
0
down vote
favorite
I use ChildWindows in my project and I need to store open state of particular ChildWindow in a property, then use that property as a condition for mentioned ChildWindow calling.
First I made this snippet of code. It has its drawbacks. So I want to use another way.
private void button1_Click(object sender, RoutedEventArgs e)
{
if (ChildWindow_02_in_XAML.IsOpen == false)
{
// await this.ShowChildWindowAsync(new ChildWindow_02() { IsModal = false, AllowMove = true, }, RootGrid);
Parameter_02_in_XAML.IsOpen = true;
}
else if (Parameter_02_in_XAML.IsOpen == true)
{
Parameter_02_in_XAML.Close();
}
else
{
return;
}
}
Now I have ChildWindow as a class, and I made following stuff:
IsOpen="{Binding IschildWindow_02_Opened}"
And I'm going to use that method that is commented at the moment.
So I have a question how to process with this variable further.
c# wpf xaml visual-studio-2015 childwindow
Are you using MVVM? More info is needed. What have you tried?
– ΩmegaMan
Nov 7 at 16:22
No, I don't use MVVM.
– DeputyOfCopyPaster
Nov 7 at 16:45
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I use ChildWindows in my project and I need to store open state of particular ChildWindow in a property, then use that property as a condition for mentioned ChildWindow calling.
First I made this snippet of code. It has its drawbacks. So I want to use another way.
private void button1_Click(object sender, RoutedEventArgs e)
{
if (ChildWindow_02_in_XAML.IsOpen == false)
{
// await this.ShowChildWindowAsync(new ChildWindow_02() { IsModal = false, AllowMove = true, }, RootGrid);
Parameter_02_in_XAML.IsOpen = true;
}
else if (Parameter_02_in_XAML.IsOpen == true)
{
Parameter_02_in_XAML.Close();
}
else
{
return;
}
}
Now I have ChildWindow as a class, and I made following stuff:
IsOpen="{Binding IschildWindow_02_Opened}"
And I'm going to use that method that is commented at the moment.
So I have a question how to process with this variable further.
c# wpf xaml visual-studio-2015 childwindow
I use ChildWindows in my project and I need to store open state of particular ChildWindow in a property, then use that property as a condition for mentioned ChildWindow calling.
First I made this snippet of code. It has its drawbacks. So I want to use another way.
private void button1_Click(object sender, RoutedEventArgs e)
{
if (ChildWindow_02_in_XAML.IsOpen == false)
{
// await this.ShowChildWindowAsync(new ChildWindow_02() { IsModal = false, AllowMove = true, }, RootGrid);
Parameter_02_in_XAML.IsOpen = true;
}
else if (Parameter_02_in_XAML.IsOpen == true)
{
Parameter_02_in_XAML.Close();
}
else
{
return;
}
}
Now I have ChildWindow as a class, and I made following stuff:
IsOpen="{Binding IschildWindow_02_Opened}"
And I'm going to use that method that is commented at the moment.
So I have a question how to process with this variable further.
c# wpf xaml visual-studio-2015 childwindow
c# wpf xaml visual-studio-2015 childwindow
edited Nov 7 at 16:56
asked Nov 7 at 15:42
DeputyOfCopyPaster
45
45
Are you using MVVM? More info is needed. What have you tried?
– ΩmegaMan
Nov 7 at 16:22
No, I don't use MVVM.
– DeputyOfCopyPaster
Nov 7 at 16:45
add a comment |
Are you using MVVM? More info is needed. What have you tried?
– ΩmegaMan
Nov 7 at 16:22
No, I don't use MVVM.
– DeputyOfCopyPaster
Nov 7 at 16:45
Are you using MVVM? More info is needed. What have you tried?
– ΩmegaMan
Nov 7 at 16:22
Are you using MVVM? More info is needed. What have you tried?
– ΩmegaMan
Nov 7 at 16:22
No, I don't use MVVM.
– DeputyOfCopyPaster
Nov 7 at 16:45
No, I don't use MVVM.
– DeputyOfCopyPaster
Nov 7 at 16:45
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53192827%2fhow-to-store-open-state-of-particular-childwindow-in-a-property%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you using MVVM? More info is needed. What have you tried?
– ΩmegaMan
Nov 7 at 16:22
No, I don't use MVVM.
– DeputyOfCopyPaster
Nov 7 at 16:45