wpf break IsVisibleChangedEventC# loop - break vs. continueWhat is the correct way to create a single-instance WPF application?WPF image resourcesFading in and fading out for a formASP.NET usercontrol: check if usercontrol is visibleHow to know if the UserControl is active other than using IsFocusedWPF UserControl ClickLoad like event in Windows Forms for any control like textbox, checkbox?UserControl with panel and buttonsIsVisibleChanged is not triggered when TabItem visibility is programatically updated
Have there been any countries that voted themselves out of existence?
What jurisdiction do Scottish courts have over the Westminster parliament?
Parallel resistance in electric circuits
How do I determine what is "magic" and "bearing magic" for Detect Magic?
Can I conceal an antihero's insanity - and should I?
How to work with a technician hired with a grant who argues everything
Maintenance tips to prolong engine lifespan for short trips
Can I disable a battery powered device by reversing half of its batteries?
Resume: How to quantify my contributions as a software engineer?
Is there a reliable way to hide/convey a message in vocal expressions (speech, song,...)
Why island and not light?
Is there any way to land a rover on the Moon without using any thrusters?
Does my opponent need to prove his creature has morph?
What are uses of the byte after BRK instruction on 6502?
Can a corpse possessed by a Dybbuk be turned via Turn Undead?
Why is the T-1000 humanoid?
How do email clients "send later" without storing a password?
Fight a biblical flood apart from building barriers
Relocation error, error code (127) after last updates
Are scroll bars dead in 2019?
Telling my mother that I have anorexia without panicking her
I asked for a graduate student position from a professor. He replied "welcome". What does that mean?
How seriously should I take a CBP interview where I was told I have a red flag and could only stay for 30 days?
Why is Kirchoff's loop rule true in a DC circuit?
wpf break IsVisibleChangedEvent
C# loop - break vs. continueWhat is the correct way to create a single-instance WPF application?WPF image resourcesFading in and fading out for a formASP.NET usercontrol: check if usercontrol is visibleHow to know if the UserControl is active other than using IsFocusedWPF UserControl ClickLoad like event in Windows Forms for any control like textbox, checkbox?UserControl with panel and buttonsIsVisibleChanged is not triggered when TabItem visibility is programatically updated
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have my usercontrol that has the IsVisibleChanged
method.. that is fired when become visibile or when hide..
I wish, in some conditions break this event to avoid the hide set.... how can I do this?
the event is this:
private void MetroContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
if ((bool)e.NewValue == true)
// goes visible
else
// hide it!
if (myCondition == true)
// here I wish break the hide event and mantain the user control visible
thanks in advance
c# wpf mahapps.metro .net-4.6
add a comment
|
I have my usercontrol that has the IsVisibleChanged
method.. that is fired when become visibile or when hide..
I wish, in some conditions break this event to avoid the hide set.... how can I do this?
the event is this:
private void MetroContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
if ((bool)e.NewValue == true)
// goes visible
else
// hide it!
if (myCondition == true)
// here I wish break the hide event and mantain the user control visible
thanks in advance
c# wpf mahapps.metro .net-4.6
1
set e.handled to true
– Denis Schaf
Mar 28 at 10:10
I haven't the e.handled property docs.microsoft.com/it-it/dotnet/api/…
– ghiboz
Mar 28 at 10:18
If you want to avoid that the control becomes hidden, why do you hide it in the first place? There is nothing you can do about this in the event handler that is being invoked in reponse to the control being hidden or collapsed.
– mm8
Mar 28 at 13:29
add a comment
|
I have my usercontrol that has the IsVisibleChanged
method.. that is fired when become visibile or when hide..
I wish, in some conditions break this event to avoid the hide set.... how can I do this?
the event is this:
private void MetroContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
if ((bool)e.NewValue == true)
// goes visible
else
// hide it!
if (myCondition == true)
// here I wish break the hide event and mantain the user control visible
thanks in advance
c# wpf mahapps.metro .net-4.6
I have my usercontrol that has the IsVisibleChanged
method.. that is fired when become visibile or when hide..
I wish, in some conditions break this event to avoid the hide set.... how can I do this?
the event is this:
private void MetroContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
if ((bool)e.NewValue == true)
// goes visible
else
// hide it!
if (myCondition == true)
// here I wish break the hide event and mantain the user control visible
thanks in advance
c# wpf mahapps.metro .net-4.6
c# wpf mahapps.metro .net-4.6
asked Mar 28 at 10:06
ghibozghiboz
4,15419 gold badges68 silver badges116 bronze badges
4,15419 gold badges68 silver badges116 bronze badges
1
set e.handled to true
– Denis Schaf
Mar 28 at 10:10
I haven't the e.handled property docs.microsoft.com/it-it/dotnet/api/…
– ghiboz
Mar 28 at 10:18
If you want to avoid that the control becomes hidden, why do you hide it in the first place? There is nothing you can do about this in the event handler that is being invoked in reponse to the control being hidden or collapsed.
– mm8
Mar 28 at 13:29
add a comment
|
1
set e.handled to true
– Denis Schaf
Mar 28 at 10:10
I haven't the e.handled property docs.microsoft.com/it-it/dotnet/api/…
– ghiboz
Mar 28 at 10:18
If you want to avoid that the control becomes hidden, why do you hide it in the first place? There is nothing you can do about this in the event handler that is being invoked in reponse to the control being hidden or collapsed.
– mm8
Mar 28 at 13:29
1
1
set e.handled to true
– Denis Schaf
Mar 28 at 10:10
set e.handled to true
– Denis Schaf
Mar 28 at 10:10
I haven't the e.handled property docs.microsoft.com/it-it/dotnet/api/…
– ghiboz
Mar 28 at 10:18
I haven't the e.handled property docs.microsoft.com/it-it/dotnet/api/…
– ghiboz
Mar 28 at 10:18
If you want to avoid that the control becomes hidden, why do you hide it in the first place? There is nothing you can do about this in the event handler that is being invoked in reponse to the control being hidden or collapsed.
– mm8
Mar 28 at 13:29
If you want to avoid that the control becomes hidden, why do you hide it in the first place? There is nothing you can do about this in the event handler that is being invoked in reponse to the control being hidden or collapsed.
– mm8
Mar 28 at 13:29
add a comment
|
2 Answers
2
active
oldest
votes
What you're trying to do, should be done before the Visibility
property is changed. The event IsVisibleChanged
will be triggered after the Visibility
is changed. So handling it will not help.
If you're using MVVM, I would suggest you to use IValueConverter
to handle this kind of scenario. Using Style.Triggers
is also one more option.
add a comment
|
If i understand right, try to use a flag and assign it as true inside your condition and then put your whole code inside the checking of this flag.
For eg:
private bool isBreaked=false;
private void MetroContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
if(!isBreaked)
if ((bool)e.NewValue == true)
// goes visible
else
// hide it!
if (myCondition == true)
// here I wish break the hide event and mantain the user control visible
isBreaked = true;
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2f55394871%2fwpf-break-isvisiblechangedevent%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you're trying to do, should be done before the Visibility
property is changed. The event IsVisibleChanged
will be triggered after the Visibility
is changed. So handling it will not help.
If you're using MVVM, I would suggest you to use IValueConverter
to handle this kind of scenario. Using Style.Triggers
is also one more option.
add a comment
|
What you're trying to do, should be done before the Visibility
property is changed. The event IsVisibleChanged
will be triggered after the Visibility
is changed. So handling it will not help.
If you're using MVVM, I would suggest you to use IValueConverter
to handle this kind of scenario. Using Style.Triggers
is also one more option.
add a comment
|
What you're trying to do, should be done before the Visibility
property is changed. The event IsVisibleChanged
will be triggered after the Visibility
is changed. So handling it will not help.
If you're using MVVM, I would suggest you to use IValueConverter
to handle this kind of scenario. Using Style.Triggers
is also one more option.
What you're trying to do, should be done before the Visibility
property is changed. The event IsVisibleChanged
will be triggered after the Visibility
is changed. So handling it will not help.
If you're using MVVM, I would suggest you to use IValueConverter
to handle this kind of scenario. Using Style.Triggers
is also one more option.
answered Mar 28 at 10:46
dhilmathydhilmathy
2,0182 gold badges13 silver badges23 bronze badges
2,0182 gold badges13 silver badges23 bronze badges
add a comment
|
add a comment
|
If i understand right, try to use a flag and assign it as true inside your condition and then put your whole code inside the checking of this flag.
For eg:
private bool isBreaked=false;
private void MetroContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
if(!isBreaked)
if ((bool)e.NewValue == true)
// goes visible
else
// hide it!
if (myCondition == true)
// here I wish break the hide event and mantain the user control visible
isBreaked = true;
add a comment
|
If i understand right, try to use a flag and assign it as true inside your condition and then put your whole code inside the checking of this flag.
For eg:
private bool isBreaked=false;
private void MetroContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
if(!isBreaked)
if ((bool)e.NewValue == true)
// goes visible
else
// hide it!
if (myCondition == true)
// here I wish break the hide event and mantain the user control visible
isBreaked = true;
add a comment
|
If i understand right, try to use a flag and assign it as true inside your condition and then put your whole code inside the checking of this flag.
For eg:
private bool isBreaked=false;
private void MetroContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
if(!isBreaked)
if ((bool)e.NewValue == true)
// goes visible
else
// hide it!
if (myCondition == true)
// here I wish break the hide event and mantain the user control visible
isBreaked = true;
If i understand right, try to use a flag and assign it as true inside your condition and then put your whole code inside the checking of this flag.
For eg:
private bool isBreaked=false;
private void MetroContentControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
if(!isBreaked)
if ((bool)e.NewValue == true)
// goes visible
else
// hide it!
if (myCondition == true)
// here I wish break the hide event and mantain the user control visible
isBreaked = true;
answered Mar 28 at 10:34
sijovwsijovw
5011 bronze badges
5011 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f55394871%2fwpf-break-isvisiblechangedevent%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
1
set e.handled to true
– Denis Schaf
Mar 28 at 10:10
I haven't the e.handled property docs.microsoft.com/it-it/dotnet/api/…
– ghiboz
Mar 28 at 10:18
If you want to avoid that the control becomes hidden, why do you hide it in the first place? There is nothing you can do about this in the event handler that is being invoked in reponse to the control being hidden or collapsed.
– mm8
Mar 28 at 13:29