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
I need to change culture mainly between two languages ; italian and English using the Combobox in WPF MVVM.
I tried to databind the ViewModel with my Mainview but I didn't succeed.
I will be so thankful if someone could help.
I am implementing scrollable text in a custom control. Each line of text has its own Visual. In the simple case of horizontal scrolling, I replace the Transform of each Visual to produce the desired effect. The scroll bar moves, but the text does not. Am I missing a step that causes the new Transform objects to be reflected (presumably as parameter changes) in the Composition Tree?
Maybe I haven't looked through enough search results, but I cannot find a reference on how to add the set of sizes of the icon to a WPF desktop application. All I have found is how to add the one icon for the application main window frame.
Can someone offer references or instructions?
All my previous WPF work has been kiosk-style (dedicated instrument control) applications that didn't need icons!
I have Multiple Lists that are bound to multiple TreeViewItems within the Tree as in the code below. This is working perfectly to display the bound items; however, I couldn't figure out how to get the selected item value. For example, if the user clicks the color Blue, I would like to be able to get that value, in this case "Blue," in order to be able to bind to a property in the ViewModel
The +/- is a styled ToggleButton (ControlTemplate\Grid\ToggleButton).
The content is a normal styled ContentPresenter(s) hosted in an ItemsPresenter (ControlTemplate\Grid\ItemsPresenter). An ItemsPresenter is a collection of Items. For the TreeView, these are additional ItemsPresenter(s) to do the hierarchy.
If I was going to do what you want to do, I'd remove the ToggleButton from the TreeViewItem style (to hide it) and place it in the item template (item template is != item style). You'll notice the trigger for HasItems sets the visibility to HIDDEN if it doesn't have items vs. COLLAPSED so the tree doesn't get misaligned.
From the ItemTemplate you'd use the same bindings pretty much. Except the DataTemplate would be something like
You don't lose any functionality by putting stuff in the DataTemplate. What I said earlier about the "bindings are mostly the same" was slightly misleading... they are, but you need to repoint the functionality ones (like the ToggleButton) to the TreeViewItem (relative source / find ancestor TreeViewItem) and not your data item. Remember, there is *always* a TreeViewItem. If you give the ItemsSource a TreeViewItem, WPF will use that instance of it, otherwise, it'll wrap your object in an implied one it creates.
As my other reply said, you don't recreate all this functionality. There is a wrapper TreeViewItem always created for you whether you like it or not . Well, there is a way to override that, but that's beyond the scope of this thread.
Last Visit: 31-Dec-99 18:00 Last Update: 16-May-22 18:43