0

I am a bit confused regarding C# WPF. How can I set a WPF window's properties from C# code? For example, trying ShowInTaskbar = false; doesn't hide the window's taskbar button, I actually have to do it in XAML for it to work. And that wouldn't be a problem, but I wonder, how do I control the GUI from C# code when using WPF.

This may sound like a retarded question, but I am trying to transition from WinForms to WPF.

1 Answer 1

2

you simply need the instance/reference of Window then you can do whatever you want with it in code.

try windowInstance.ShowInTaskBar = false in code it should work

Sign up to request clarification or add additional context in comments.

2 Comments

That's why I am confused. The window instance doesn't have a ShowInTaskbar property, it has ShowInTaskbarProperty and it is readonly.
Ah, yeah, nevermind. Seems I'm stupid. I will accept your answer in 7 minutes, when I am allowed. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.