i did this:
this.combobox.ItemsSource = Common.Component.ModuleManager.Instance.Modules;
to bind the combobox to a collection, which is located in an other project/namespace. But i had to move the ComboBox into a DataTemplate.
Now i need to do something like that:
<ComboBox ItemsSource="{Binding Common.Component.ModuleManager.Instan...
I have a listbox defined in XAML as:
<ListBox x:Name="directoryList"
MinHeight="100"
Grid.Row="0"
ItemsSource="{Binding Path=SelectedDirectories}"/>
The SelectedDirectories is a property on the lists DataContext of type List<DirectoryInfo>
The class which is the datacontext for the ...
In windows form I have a reference to WPF wrapper which wraps WinForm control. I would like to handle events in WinForm control as usual and then invoke apropriate routed commands from WPF wrapper. Can it be done?
...
I have a WPF Application basically the exe is a loader for the application UI and sometimes when a unhandled execption occurs the message box is shown and when I click ok it goes away,the UI vanishes etc..,the instance of the exe is still there,I need some mechanism that when and exception that is unhandled occurs shutdown the exe since ...
I have a textbox and it need the user not allow to enter any specialcharecters
He can enter 1. A-Z
2. a-z
3. 0-9
4. Space.
How can I make the KeyDown event to do this?
...
I am developing WPF Application. In that iam loading images in Listbox. Is there any way to know that images having low resolution. I want to show low resolution images with warning. Plz help me regarding this query.
Thanks in advance.
...
In WPF, where can I save a value when in one UserControl, then later in another UserControl access that value again, something like session state in web programming, e.g.:
UserControl1.xaml.cs:
Customer customer = new Customer(12334);
ApplicationState.SetValue("currentCustomer", customer); //PSEUDO-CODE
UserControl2.xaml.cs:
Custome...
I'm writing my first WPF application and I'm trying to implement a fade animation when the form closes. I came across this question http://stackoverflow.com/questions/867656/fading-out-a-wpf-window-on-close which shows how to make a fade-out animation but I can't seem to get it working. I have this in my XAML:
<Window.Resources>
<St...
What's the difference between the two, when should RegisterAttached() be used instead of .Register()?
...
Hi,
First some background: I'm working on an application and I'm trying to follow MVVM conventions writing it. One thing I'd like to do is to be able to give the application different "skins" to my application. The same application, but show one "skin" for one client and a different "skin" for another.
And so my questions are:
1. Is i...
I have a scenario in which I need to have both static and dynamic menu items. The static items will be defined in XAML and the dynamic ones supplied by a View Model. Each dynamic item will itself be represented by a VieModel, lets call it a CommandViewModel.
A CommandViewModel has amongst other things a display name, it can also contai...
I have a ListView with a GridView with 3 columns. I want last column to take up remaining width of the ListView.
...
So, I have a ListBox which is bound to a list of business objects, using a DataTemplate:
<DataTemplate x:Key="msgListTemplate">
<Grid Height="17">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding MaxWidth}" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBl...
Hi,
Related to an earlier question I asked, I've seen that there's both LoadComponent() and XamlReader.Load(). They're similar enough that I'm not quite sure which one I should use in what case.
So, in essence, what's the difference between the two?
Thanks!
...
When the WPF ComboBox is clicked and in-focus, the only interaction that occurs after that can be with the ComboBox. If anything else is interacted with, including the window functions (minimize, restore, close, resize) and any control in the window, the action is ignored and the ComboBox loses focus.
In addition, MouseEnter and MouseL...
A quite simple and straightforward example.
I have a window. It has CommandBindings set to catch a RoutedUICommand execution.
<Window
...
>
<Window.CommandBinding>
<CommandBinding
Command="{x:Static local:Commands.Command1}"
Executed="OnCommand1Executed"
CanExecute="OnCanCommand1Exec...
Hi ,
i'm working on Linq To Sql,WPF and i have a database now i need to save some picture in the database but i don't know which is the correct datatype to save the pictures Database(this database would be connect from 10 users in the same time).
Can you point me in the right way to overcome this step?
If i didn't wrong it is not a good...
I got a TreeView and want to display the Data nested (not hierarchically). The first level data is called TaskViewModel, the second level data is ArtifactViewModel. I want the ArtifactViewModel horizontal inside a GroupBox which represents TaskViewModel.
I tried different approaches, this is my last one:
<TreeView Name="tvTasks" ItemsSo...
How do you determine the width of the text in a WPF TreeViewItem at run time?
I need to calculate an offset so I can draw a line from one leaf to the leaf of a different TreeView. All the 'width' properties return a size that is way bigger than the space taken up by the actual text of the node. It must be possible because the Select f...
I have a ListBox showing items using the following DataTemplate:
<DataTemplate x:Key="PersonTemplate" DataType="{x:Type DAL:ResultItem}" >
<StackPanel Width="280" >
<TextBox BorderThickness="0" IsReadOnly="True" Background="Transparent" Text="{Binding FullName1, Mode=OneWay}"/>
...
</StackPanel>
</DataTemplate>
I am using...