When I run the app, it crashes and throws the following exception which can be investigated in the Application_UnhandledException handler in the App.xaml.cs.
Error HRESULT E_FAIL has been returned from a call to a COM component.
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth
Note: If I reduce the amount of hierarchy layers of the box collection, everything works fine.
Please help, I have been struggling for several days. I cannot find anything in forums or blogs.
All or some of the text can be a hyperlink, with different commands bound to the links. The content of the messages will be automatically generated.
My first thought was have a table like this:
ImageName MessageDate Message ================================================================================================================
vehicle.jpg 2014-05/06 Vehicle Ford F150 Serial # ^L^256565^L^ has maintenance item ^L^Oil Change^L^ ready.
So it would look like:
"Vehicle Ford F150 Serial # 256565 has maintenance item Oil Change ready."
Clicking the serial # would open the vehicle screen. The Oil Change link would open the Maintenance screen.
I would then need to include in the message an action for each link. Like the link symbol, I could follow it with an enum item to denote what type of screen to open. And I would also need the PK's in there also.
Then, when the dashboard item is loaded, it would use a flow panel with both text and links in the data template so the Message column can wrap.
All this is fine, but it feels weird. Anyone done anything like this? Anyone got a better approach?
Exactly, but it seems that you just happened to use the correct word. System.Action is the class to use, or (more typical in WPF) a Command object (take a look at the Command Pattern). When the link is clicked, you call the Invoke() method of the Action object.
I am currently developing an application but I need to have to switch between two languages , but I can't do it .
In fact , I created two Resources files for both languages and I set them to public and then then I put the propertie to Static as mentioned in many tutorials .
Thank you so much for your help.
My code written :
if (Presentation.ViewModels.LoginWindow.LanguageSelect != null)
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("it-IT");
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-FR");
Console.WriteLine("Verify the choosig langa=uage!");
I am creating a user control. I will be using this user control in a few different apps. Once it's done I'll include its assembly in my project, reference it, and use it in my XAML somewhere. Pretty standard.
The question is... How do I apply a different set of styles to it based on the app I'm in?
The simplest way to achieve this is to have application level themes. In other words, in App A - you would set the styles for your control to be the ones you want in App A; in App B you set the styles for the control based on the ones you want in App B, and so on. Make sure you have a default theme for your control in place as well.
1.You can create a seperate styles for appA, Appb... and apply the theme accordingly as a staticresource.
2.Suppose in same application you want different theme based on some action then just use the above mentioned idea and apply themes using Dynamicresource.
I am new in coding WPF MVVM apps.
My question is how to change le language using a combobox at Runtime.
I tried the static resources and it worked well , but trying to change it Runtime using Threading.thread class didn't work.
Is there any possibility to solve that problem.
This is now the FOURTH time you have asked the same question.
DO NOT repost the same question. It won't get your question answered any quicker; if anything, it will just annoy the people who would otherwise be trying to help you, and result in all of your questions being ignored.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer