wpf

WPF DataTemplate and Binding

I am DataTemplating a listbox's itemsource to display a label and combobox. In the, datatemplate I am assigning a new itemssource to the combobox but cant get it to work. Or Ideally, how can I bind the combobox in a datatemplate to a different source. Thanks. Mani UserControl: <DockPanel> <ListBox x:Name="lstBox" ItemsSource...

wpf forcing update UI window during a procedure

Hi everyone! I need only to show a custom control (a clock with rotating hands) and with this to replace the mouse cursor, if I use a file .cur or .ani to replace the mouse cursor Me.CUrsor = New Cursor("absolute path of the .ani file") there is no problem: I can change the cursor during a procedure: but the quality of the animation is ...

UserControl opacity 0 but still clickable

I've got a UserControl which has an opacity of 0. At that state it shouldn't be clickable. How to disable/re-enable it? ...

FlowDocument replace Section?

I have a FlowDocument with two Sections. One is named 'Inhalt'. Trying to replace it with another Section doesn't seem to work: InfoBoxAuditorium.Inhalt = InfoBoxAuditorium.Resources["DokumentWohnzimmer"] as Section; What am I doing wrong? ...

WPF: Determine/Set position of vertical Scrollbar

I've got a FlowDocumentScrollViewer with a vertical scrollbar. Now I want to know its position and also be able to change it. ...

Accessing unity container in view model class

I have a shell which looks like toolbar and defines my main region (a wrap panel). What I need to do is be able to add widgets to the shell and when a widget is clicked, a new window (view) is opened. Below is what I have so far: I created a module class which adds a view to the main region: public class MyModule : IModule { protec...

how to cleanup view model properly?

hello, i have a view model that is used as the data source for my custom control. in the view model's constructor i set up a WMI ManagementEventWatcher and start it. my view model implements IDisposable, so i stop the watcher in the Dispose method. when i embed the custom control into a window, and then close the window to exit the app...

How Do I Set Multiple Content Dynamically in a Button in WPF

I created the following xaml: <Button x:Name="PriceButton"> <Button.Template> <ControlTemplate> <Border x:Name="ButtonBorder" CornerRadius="2" Background="{StaticResource DarkReflectionBrush}" BorderBrush="Black" BorderThickness=...

WPF Webbrowser Theme

I have a WPF usercontrol that is hosting the Webbrowser. The usercontrol is placed on a WPF Window. When I run the application (IDE or compiled), and display the following HTML inside the webbrowser: <INPUT TYPE=Button>Button</INPUT> The button has the 'ugly' Windows 2000 look. Even though I run with Win7 Aero, and the rest of my appli...

WPF DataTemplate and Binding - Is this possible in xaml ?

I am DataTemplating a listbox's itemsource to display a series of comboboxes. I want to give the 'DisplayMemberPath' of the combo to a property, which is in a different source than its own 'ItemsSource'. (Assuming DisplayMemberPath is just a string representing name of a property, I am getting this from the user). I have achieved this wi...

PagedCollectionView groupings don't seem to automatically be refreshed when a new element is added to the source collection.

Hello, I'm using a PagedCollectionView to bind an ObservableCollection<T> to a DataGrid in my Silverlight app. In this case, the source collection can incur an unbounded number of updates during its lifespan. It seems, however, that if I'm using a PropertyGroupDescription to group the elements in the DataGrid then I need to reapply that...

RadDatetimepicker capture the date

I am working with WPF and C#. I want to fire an event when the user modifies or selects a date on my raddatepicker control. What event handler should I be using for this? I want to be able to convert this captured date to a SQL server 'datetime' variable for use in the backend. ...

Adding items in WPF ListView with columns.

I use this XAML code for the ListView: <ListView> <ListView.View> <GridView> <GridViewColumn DisplayMemberBinding="{Binding Path=Flag}" /> <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}" /> <GridViewColumn Header="Ip Address" DisplayMemberBi...

Close combobox after n seconds

I have a combobox that stays open if the user does not make a selection. I'd like to use a trigger to close the combobox after 2 seconds. Here is a portion of my combobox style that includes my failed eventtrigger attempt at accomplishing this: <Style x:Key="ComboBoxStyle" TargetType="{x:Type ComboBox}"> <Setter Property="FontFamily...

Visual Studio C#, WPF controls

Hi guys. I'm making a simple program in Visual Studio C# for school and I'm using the WPF Controls. I'm making some type of monthly report that I need to visualize in a table with the columns that represent the days. The problem is that I don't know which control to use. I tried with with the ListBox but it does not give a good result ...

Increasing the size of a WPF application

Hi all, I've just created my first WPF application (3 calculators inside 3 different tabs). The entire application has been built using widths/margins/paddings as static values, since I originally didn't know that dynamic values can be used by just putting an asterix after the value. The client has come back to me though and has asked...

Slow when swapping Content values in a ContentPresenter

I am experiencing performance problems in a WPF application which contains a series of Infragistics grid views with the intent of a quick "scroll" effect without needing a scrollbar . I have taken the problem down as low as I can go by pre-building all the views in separate grids and then swapping the respective "active" view in and out ...

Is it possible for a button click to permanently change an image's source using only a XAML trigger?

I'm trying to solve the following problem on a WPF datagrid: I've templated the DataGrid items to contain a button - when clicked, it displays the RowDetails for the grid. I'm having trouble getting that button styled the way I want. Specifically, I want it to appear as a "hyperlink" with a small plus-sign icon next to it. When clicked ...

WPF - Creating a dynamic datagrid in xaml by datatemplate

I am trying to create a DataGrid by datatemplates. The reason is I want the columns to be dynamically created but all in xaml and not in code behind. I get a List based on which I want to create my grid columns in xaml. class GridColumnElement { public string HeaderCaption { get; set; } public string PropertyName { ...

how would I access this WPF XAML resource programmatically?

how would I access this WPF XAML resource programmatically? <Grid.Resources> <Style x:Key="lineDataPointStyle" TargetType="chartingToolkit:LineDataPoint"> <Setter Property="Background" Value="DarkGreen"/> <Setter Property="IsTabStop" Value="False"/> <Setter Property...