Yeah, at first glance this seems basic. But here's the problem: I'm using MVVM and hierarchical data binding to populate the tree.
What I'm having a hard time doing is getting the first node to expand. The reasons are:
I don't have a direct reference to the tree since I'm in the view-model code. (MVVM is driving me nuts).
I've actual...
This is my attempt to create a ObservableCollection in VB that is WPF thread-safe. Can you think of any problems it may have?
Public Class WpfObservableCollection(Of T)
Inherits ObjectModel.ObservableCollection(Of T)
Public Sub New()
End Sub
Public Sub New(ByVal list As List(Of T))
MyBase.New(list)
End Su...
Hi, how can I get the constituent controls making up the TreeViewItem in code if they are inside a hierarichicaldatatemplate?
<HierarchicalDataTemplate DataType="{x:Type local:Module}" ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal">
<Image Width="16" Height="16" Margin="3,0" Source="I...
I want to make 2 different styles for the ToolBar control: One is based on black buttons and one on silver buttons. But I can't figure out how to apply my button styles to its own toolbar styles. The following only allows one style for the buttons:
<Style x:Key="{x:Static ToolBar.ButtonStyleKey}"
BasedOn="{StaticResource Black...
For example: if I want to get txtControl and set its Text property in the code behind of subPage.xaml.
Thanks,
...
For example: if I want to get txtControl and set its Text property in the code behind of subPage.xaml.
<Page x:Class="Prototype.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibil...
Fairly new to WPF...
I have a collection of data I would like to bind to a grid panel. Each object contains its grid row and column, as well as stuff to fill in at the grid location. I really like how I can create data templates in the listbox XAML to create a UI with almost nothing in the code behind for it. Is there a way to create...
I would like to add a control to my app where the user can browse his local file system and select a directory. I would prefer to host this control on my main app window, and not do this via a pop-up dialog.
...
While looking at solutions for tying an enum to a group of RadioButtons, I discovered Sam's post from a year and a half ago.
Lars' answer was exactly what I was looking for: simple and effective.
Until I started changing the object tied to the RadioButton group. A simple version follows.
The XAML:
<Window x:Class="RadioEnum.MainWindo...
This works, but I don't think I'm doing it right.
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Aam.Gui;component/AamBlue.xaml" />
<ResourceDictionary>
<gui:RepKeyValueConverter x:Key="RepKeyValue...
I would like the TreeView below to expand to fill the current row that it is contained within, however, I can't figure out how this is done. It just expands to fit the tree items. Can this be done, and if so, how?
Thanks
<Window x:Class="WorkoutUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xm...
I want to use type-down in data grids. With combo boxes this is just the TextSearch.TextPath property.
What property/code would I need for data grid?
...
Say I have a project that contains a Window.xaml and ResourceDictionary.xaml. In the Window I pull in via its MergedDictionaries the resource dictionary.
If the main app contains both, then I can set Source to simply "ResourceDictionary.xaml".
Yet if they are in a DLL assembly, then I must set Source to "/MyLibrary;component/ResourceDi...
When I correct errors the red box around the cell disappears but the "!" mark indicating row validation errors doesn't go away.
This only seems to occur with a DataGridComboBoxColumn, text columns work correctly.
What could be causing this?
...
I have not had any luck merging wpf assemblies using ILMerge.
...
I'm trying to create a Window-derived class in XAML which can take a generic argument, but I can't seem to define the generic argument in the XAML so that it generates the partial class matching my code-behind file.
What I'm trying to accomplish is a replacement for all the MessageBox calls for asking the user questions, where I can giv...
Hai am using wpf list box, i cannot able to clear the list when am calling the reload data function, i just want to reload new data at runtime,while page loading it loads the data correctly, when i refresh the new data is fetched in itemsource i can see that in debug mode, but no new data in listbox, old data remains in the list, i cant ...
Hi All,
I want to set focus to a textbox always. I am creating a application in wpf, in the search page there is a textbox i want to set focus to that textbox always, if the user clicks anywhere in the page the taxtbox should gain the focus. How to achieve this task.
Geetha.
...
Is there a way for a model to explicitly cause validation to occur? I'm particularly interested in causing row-validation in a DataGrid.
...
How do I use cell and row validation with DataGridTemplateColumn?
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataType}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
...