Incorrect Button State with WPF Command - wpf

First, let me start off by stating that I will be more than happy to post whatever code or other information I need to in order to help resolve this issue. Unfortunately, at this time, I am just not sure what I need to post.
I have a WPF application that uses the Microsoft Ribbon library. I know the ribbon control has been rolled into the 4.5 framework but since I am still deploying to some XP machines, I am forced to use the 4.0 framework. I mention this only in case there is some obscure issue with the old library.
In the application, I have a RelayCommand that is bound to one of the ribbon buttons that does not enable itself correctly (or at all for that matter). The code that is in place to determine if the command can execute is the exact same as the code for a few other buttons. These other buttons behave correctly. Even worse, the behavior is correct on my machine but not on any of the other machines that I have tried it on. It doesn't appear to be isolated to XP or Windows 7. Even worse, I have placed a regular button in the interface that calls the CanExecute method for the command and it reports a value of True even when the button is disabled.
I am at a complete loss of where to start looking. Perhaps someone can steer me in a direction of where to begin.
Thanks in advance to anyone who is able to assist me in my desperate state.
* EDIT *
On a whim, I installed .NET 4.5 on the machine that was not functioning correctly as this was a glaring difference between the development (my) machine and the other machines. To my surprise, this corrected the issue. That said, are there updates to the .NET 4.0 framework that are applied by installing version 4.5? As I mentioned above, I am targeting some XP machines so I cannot install 4.5. Perhaps there are some other updates that can be installed without installing 4.5?

Related

Combo Box / Context Menu strange behaviour (invisible)

I have written an application in WPF/VB.net and have been testing it on a few different computers.
I have never experienced this issue on my development machine but one of my test machines has a strange issue where combo box lists and context menus are invisible.
The objects are there and you can select items from them but they are not being drawn.
I am scratching my head with this and have been searching for evidence of similar issues online but not really found anything.
I would like to completely rule out that this is a programming issue before going down the route of pointing the blame at any particular hardware my company is using.
I am using one click deployment and have transparency enabled on my windows.
This is an intermittent problem and restarting the PC will fix the issue. Restarting the application does not make the issue go away.
Thanks
Check that the machine you have problems with has the correct .net framework loaded. If you are using any other products such as Silverlight then check versions.
This issue was fixed by forcing software rendering on windows XP within the App.
This was done by adding the following line to application start up.
RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly

Silverlight on Windows 8

I'm running my SL5 application (that has been working well so far) on Windows 8, and it is not going well. I have a background picture which usually does not render correctly, almost everytime I navigate my background (including the controls over it) just goes white till I resize IE, then it re-paints (what makes it stranger is that the parts that goes white is outside of the navigation frame, why is it getting repainted). (Chrome renders fine)
When I run my application out-of-browser my login screen pops up and works correctly but after the login screen closes it looks like the gray background of the login screen remains behind and I cannot click on anything, resizing makes no difference, it looks like every control has been disabled.
I have updated my NVidia Drivers to the latest, don't think its a display driver issue though.
Anyone else had these issues? Anyone else running SL5 fine on windows 8?
(Looks like I'll be downgrading back to windows 7 soon)
Silverlight should run great on any desktop browser in Windows 8, just like it does on Windows 7, Vista, and Mac. The underlying runtime is 100% the same. That does not mean you may not find a glitch with a graphics driver, but it means you shouldn't - and likely won't.
I did want to make a clarifying point, however, that Silverlight is not part of the Modern Internet Explorer (the Metro Internet Explorer). Only a subset of Flash is supported and that is only supported on white-listed sites.
This means Silverlight solutions that you might have expected to run on the Surface RT (running Windows RT - or Windows on Arm) will not run (as there is no SL runtime). And, I think we can all have a collective moan and ask, together, "Why not?" To which there is no acceptable answer.
The theoretical goal, of course, is to write native Windows 8 apps. If you want to write something web based you should write it in HTML5. That's the official word. I think we all know that HTML5 has a ways to go in order to catch Silverlight, but it is what it is. Can't change some things.
I have had no issues with any of my Silverlight 5 apps running on Windows 8 - I focus mainly on line of business apps but have some graphical and otherwise apps that run fine as well.
I'm only marking this as the answer to close the case, what the actual answer was to the problem we will never know. The solution: automatic updates. After much hassles with getting automatic updates to actually go through, my machine is now working well.

Snoop utility for WPF apps is not working - does it support WPF 4?

I have a WPF 4 application running on Windows XP. When I run Snoop, it picks up the application, however when I click on "Snoop this application" nothing happens. Also when I click on the magnifying glass nothing happens.
Any ideas?
If you are running your application in administrator mode then Snoop will not work unless you don't run your Snoop in administrator mode , so better check what privilege you have given to Snoop.
The new version of Snoop supports WPF 4 (http://www.cplotts.com/2010/02/14/snoop-now-supports-wpf-4-0/).
Which version are you using?
The latest and greatest version of Snoop is always available at http://snoopwpf.codeplex.com.
One thing to note is that the source code (available for download) is usually somewhat out of date ... as compared to the released bits which you can download an installer for. That is, I don't release Snoop for every fix/change I make.
For example, the currently released version is v2.6.0 ... but I have 9 work items marked for v2.6.1. Check out the Issue Tracker for more info on what is in each version.
I have had the same problem, but only with the msi (the installer). So, I downloaded the source code and rebuilt Snoop on my machine, and after this, it all works fine.

WPF Application Hang

I'm using Windows 7 Professional (x64) and having installed .NET 4.0 RTM on my machine.
Since 2 days I'm noticing that every WPF application that I'm trying to run hangs and becomes non responsive (a not responding text is appended to it's title bar) and it's painted white.
There is no info regarding any exception, no error message. Nothing. Even the Event Log shows that there was "application hang" event (code 1002) and nothing more.
This problem is for everything that is written in WPF, even for products like NHibernate Profiler and other stuff that I was using on a regular basis without any issues.
Tried to reinstall .NET 4.0 and nothing changed. Any ideas why this might be happening?
I had the same problem. It was a corrupt font cache!!
See http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7cc032c1-5f4d-4518-adc6-f53afd051e6b for a solution.
If I had to guess I would say video drivers. It might help to try attaching Visual Studio's debugger to the hung process (Debug -> Attach to Process) making sure that Managed Code is the selected debugger type. Then you can break into the debugger and maybe see a common stack trace.

Running a WPF application on Windows XP

I recently built a new application using WPF, so that I can learn the new technology. Now that I am trying to deploy the application, it appears as if it is running fine on a Vista system, but on a Windows XP SP2 machine with the .Net fx 3.5SP1, it's not able to load the PresentationFramework.dll file.
I did some further investigation into this and discovered that there is a slight build difference between the PresentationFramework.dll files on my xp test machines vs. what is on my Vista development machine.
What I'm curious about is if anyone else has run into this issue as well, and what they did to remedy the situation so that they could develop on Windows Vista, but deploy the developed application to both Vista and XP clients.
Thanks.
I need to add to this a bit... on the vista machine and on the client machine, I've got .Net Fx 3.5 SP1. I had done a bit of digging, and found out that the PresentationFramework.dll file is the same, except the last set of versioning numbers.
Has anyone found a decent work around for this issue?
Sorry that I left this stagnant, but I figured out the issue I was running into. Turned out that there was corruption in the Windows XP box I was using as a test bed.
I was working between stackoverflow and another forum for the package I was writing the Add-in for. When I learned of the answer, this is what I posted, in case I ran into issue in the future.
I thought that I'd post this here, so
that I would have reference, and also
in case anyone else would need
reference to it for the future... I'm
working on another Dinerware Add-on
using WPF, and although it was running
fine on my development machine, every
time I'd go to run it on a test
machine (a machine ghosted like it was
in the field at a customer's
location), I kept getting weird
processing errors.
I did hours of searching online, only
to come up empty handed until I ran
across this article:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6e5de3d8-fc02-4504-b00f-7a2192d24a48/
which gives a link to the download of
the WIC (Windows Imaging Components),
located here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=8e011506-6307-445b-b950-215def45ddd8&displaylang=en
For some reason, what is/was happening
is that the Windows Imaging components
have become corrupt against what my
application is looking for. TO fix
the issue, you have to:
1) navigate to
%windir%\$NtUninstallWIC$\spuninst\
and run the spuninst.exe file in
there. That will remove the Windows
imaging components. 2) after you have
completely removed the components, you
will then re-install them using the
second link from above.
So far, I've not run into any further
issues.
What a crazy thing that
was?!?!?!?!?!?!!
Hopefully, if someone else runs into this issue, I may be able to help them out quick by >putting this out there.
As I said on that forum... hopefully this helps someone else out that runs into this issue in the future.
I've done a bit more experimentation and built a test WPF project and used a Setup and Deployment project instead of a WiX installer. for some reason, the application is working fine when its installed with the Setup and Deployment installer, but when using WiX, it's having issues...
Beginning to think the issue has to do with WiX, and not the .Net Fx version/build
You can have this problem sometimes with templates and Blend, although I thought it had been fixed in the latest Blend. Basically when Blend "pulls in" information for making a new template, it can sometimes copy in Aero only stuff from Vista, which means the control you then create is then reliant on Vista :-(
I did think this was fixed though, although you may have been bitten by it if the project has taken a while to put together.
Make sure that .NET Version on your Vista and XP machine are same.

Resources