RibbonWindow.Hide() and Window.ShowDialog() problems on .net 4.5 - wpf

I changed the .net Version of my WPF Application from .net 4.0 to 4.5 and replaced the old ribbonlibrary with the new one (System.Windows.Controls.Ribbon).
After that I noticed some strange behaviour on the following case (which works fine before):
The Main Window is a RibbonWindow.
A RibbonButton executes a Command with this simplified code:
App.Current.MainWindow.Hide();
new Window().ShowDialog();
When the modal Dialog shows up the CPU goes mad:
If I remove the Hide() line, it works fine.
Am I missing a change on the ribbon controls library for .net 4.5 or do I using it wrong?

Related

.NET Core 3.1 Windows Forms Designer Bug?

I've created a .NET Core 3.1 Windows Forms app and am trying to add a RadioButton inside a Panel inside a TabPage using the designer but it won't let me. Am I doing something wrong, or is this a bug?
In addition, I cannot reposition the Panel using the mouse, only cursor keys.
I can do this just fine in a .NET 4.7.2 app.
You can double click to user control on components panel.
It will be added to 0,0 coordinate on Windows form.

Popup window (in WPF UIAccess application) not rendered in Windows 10

An application that I've written (https://github.com/JuliusSweetland/OptiKey) requests UIAccess (to be able to be rendered above everything) and has a modal popup window styled using MahApps.Metro. When run on Windows 8/8.1 everything is fine, but on Windows 10 the popup window does not display (is not rendered anywhere), but is visible in the taskbar. Hovering over the thumbnail displays the preview, but the window can never be made visible.
I have narrowed the problem down to Windows 10 and whether the UIAccess="true" setting in the manifest is true/false (it is fine if set to false).
I initially thought the problem was linked to the .Net 2.0.0.0 runtime not being present on a default install of Windows 10, as the problem went away when I installed Snoop (which I think installed .Net 3.5 and so the 2.0.0.0 runtime), but to prove the fix I uninstalled .Net 3.5, which brought back the issue with the child window, and then re-installed .Net 3.5, which did NOT resolve the issue again.
I have tried the following:
Running application as admin = no fix
Updating all graphics drivers = no fix
Checking the event logs = nothing
Converting my child (popup) window to be non-modal = no fix
Converting my child (popup) window to be a standard Window class, rather than a MetroWindow (MahApps) = no fix
4 & 5 = no fix
Installing .Net 3.5 = no fix
The only thing that works is setting UIAccess="false", but I need it to be true.
N.B. UIAccess is working correctly on Windows 8.1, and I have fulfilled the requirements (adding UIAccess="true" to the manifest, signing the assembly, and running from a protected directory "Program Files")
Any idea what is going on?
Found the issue - as part of launching the child window I was setting the parent window's TopMost property to false (and then setting it back to its original value when the child window closed). Something about setting parentWindow.TopMost=false was causing the invisible child window problem. I removed the relevant lines (in this commit: https://github.com/JuliusSweetland/OptiKey/commit/e9031119a726518f54da94c64faceeee991b3747) and everything works again.

WinForms designer breaks on VS2005 when using Windows 7

We have an old project that is designed using VS2005 and WinForms. Everything works perfectly on Windows XP, but when I open the designer on Windows 7, everything breaks down.
The controls get sized to random size and some of them dissappear (or are moved to random coordinates).
What can we do to solve this issue? Should we switch to VS2008?
A newer version of VS should help, but i'd be surprised if this can't be fixed in 2005.
Try commenting everything out in the method where initializeComponent runs, or any properties that set UI change. You should find it easy enough, it's a method that has long lists of calls against the controls on the form.
The problem was that we used TableLayoutPanel inside a GroupBox and not on the form. When we added the TableLayoutPanel on the form and moved the GroupBox into it, the designer stays ok.

problem with expander control in publishing

I have expander control that it works in vs and blend correctly but when i build a setup file and executed it cant work correctly.(does it work correctly in win xp?)
It works fine on Windows XP. But you should install latest updates for .net framework.

Problems with XAML WPF 4.0 Editor in VS2010

Wondering if anybody else has found some very odd behaviour with the XAML/WPF 4 editor in VS2010, and can explain what is going wrong. This only occurs if the project is using .NET 4.
Whenever I tried to open a XAML document for editing, the window would appear to open for a split second and then vanish, but VS2010 would still list the window as open.
The fault was eventually traced to having the "Reuse current document window, if saved" option under "Documents" in the "Environment" options checked. Once this was unchecked XAML 4 files opened as expected.
As I said, this only appears to occur on projects targeted at .NET Framework 4 - those targeted at 3.5 worked without a problem, and the "Reuse current document window, if saved" appears to work fine on other files.
you can use online XAML editor http://www.silverlightshow.net/news/New-Online-XAML-Interface-Designer-Released-Open-Source.aspx

Resources