wpf

How do I create a ribbon bar in WPF?

How do I create a ribbon bar in WPF, like in Office 2007? ...

WPF: Modifying a ControlTemplate property from a DataTemplate?

Hi, Using an MVVM approach to WPF, I have a view model class called SubButton. It is styled as follows: <!-- SubNavButton Appearance --> <ControlTemplate x:Key="SubNavButton" TargetType="{x:Type RadioButton}"> <Grid Margin="5,5"> <Rectangle x:Name="rectBackground" Fill="DimGray" Stroke="#FF000000" Width="150" Height="40" St...

How to display in each ListBoxItem textblocks with binding to a filelds of a different tables

Greetings to all and sorry for my English! I have a ListBox, it's ItemsSource = myClientsList.DefaultView. The Items of ListBox have a template (ControlTemplate), that is defined in a in a separate resource file. Every Item contains a little TextBlock's, Text -property of each have a binding to fields of my Object myClientsList. I need ...

easy way to write report on data

looking for a good easy way to generate reports on data my application holds. rather than building it painfully by writing it all out and formatting it with /n 's etc is there an easier method? It could be into excel, or just a list... Maybe the only way is to do it like I was thinking... ...

WPF Storyboard stops by itself

I have a storyboard that seems to stop randomly by itself, I cannot for the life of me figure out why. It seems to stop and random intervals. private void CreateStoryboard(int from) { int? targetTo; Duration dur; targetTo = 150; dur = 150; Int32Animation element = new Int32Animation(); ...

WPF: How to make button (splitbutton) enabled when it's bound command cannot execute?

Hi, I am building a custom splitbutton that consists of two overlapping buttons, and popup - like this (image shows some generic splitbutton): My SplitButton opens popup whan a right side with arrow is clicked, and executes SplitButton.Command when a main button is clicked. In my case however sometimes the default action cannot execu...

WPF Themes and TemplateSelectors

So I'm going through a style (in this case, WhistlerBlue.xaml) and I'd like to be able to use TemplateSelectors with my data. However, this seems a fallacy because it just doesnt seem to work! How can I (Aside from carte-blanch commenting out the offending style, the ListBoxItem style) use a DataTemplateSelector with it? ...

How do the RoutedCommand constructors differ from eachother?

The RoutedCommand in WPF has 3 overloaded constructors. Consider the following: public static RoutedCommand AddTextFieldCommand = new RoutedCommand(); vs public static RoutedCommand AddTextFieldCommand = new RoutedCommand("AddTextField", typeof(DesignerWindow)); What advantage does the second one have? Does it make it easier to d...

DepedencyProperty within a MarkupExtension

Is it possible to have a DependencyProperty within a MarkupExtension derived class ? public class GeometryQueryExtension : MarkupExtension { public XmlDataProvider Source { get; set; } public string XPath { get; set; } public static readonly DependencyProperty ArgumentProperty = DependencyProperty.RegisterAttached( ...

WPF: Accessing two DataContexts in the same control

Hi, I am using an MVVM approach, and I have an object from my ViewModel called DatabasesSubFrame which is DataTemplated to show a ListBox. I want to display a Button below the ListBox, which binds to both the currently selected item, and a property on the DatabasesSubFrame object which is being DataTemplated. I know how to refer to the...

ListView with nested Expander not collapsing

This question is the same as this other unanswered question. When the Expander is expanded the outer ListView grows to make space for the expanders contents, but when the Expander is then collapsed the view does not force the ListView to resize. Reduced code, with notes after: <!--<StackPanel>--> <ItemsControl> <!-- ParameterGroupV...

WPF - Is RenderTargetBitmap better than changing an Image Source?

Im trying to create a PNG sequencer class that will allow me to change an ImageBrush's ImageSource property via an animation. The issue is that I have around 150 PNG files to load, and it really really affects performance when I have a few animations on the screen. I have read a little about RenderTargetBitmap and also WriteableBitmap ...

Easy way to order WPF tag attributes

Hi All, I've started to do some WPF development and I'm switching between xaml and the designer. This causes the attributes for each element to be ordered differently, which makes things hard to read unless I go though and order everything manually. Is there an easier way to do this? eg. ...

How to disable drag thumb on a ScrollBar in WPF?

Two question: How to disable drag thumb on a ScrollBar in WPF? Is there a way to limit drag thumb position? like LargeChange or SmallChange? ...

'Missing' library at design-time in VS2010?

Hi one and all, I located a really nice open-source docking solution called 'AvalonDock' on codeplex, and downloaded v1.1, and included the dll in a WPF project in VS2010 Beta 2 (targeting .NET 4.0) - so far so good. Then I saw that V1.2 was available and it fixed exactly the issue I was having (V1.2 exposes a DP called DocumentsSource...

How to access a component in a style in wpf?

I rolled my own tab control with left and right buttons that, when clicked, scroll the entire tab control one way or the other. I have functionality that I can't exactly do in XAML, so I need access to these buttons in coded-behind. They are in my Tabcontrol's style, and if I assign names or x:names to them, I still can't access them i...

How to make simple combobox with selected value in XAML?

What is the correct syntax to select a combobox item with value (not index) in pure XAML? Doesn't work: <StackPanel> <ComboBox SelectedValue="CA"> <ComboBoxItem Tag="CO">Colorado</ComboBoxItem> <ComboBoxItem Tag="CA">California</ComboBoxItem> <ComboBoxItem Tag="NM">New Mexico</ComboBoxItem> </ComboBox> <...

Partial Trust in WPF 4

...

WPF WebBrowser invoke a VBScript and retrieve its return value

Hi I have a WPF WebBrowser which loads a HTML page with vbScript functions on it from intranet I want to execute one of these functions and retrieve the return value. Unfortunately I have no ability to change the the intranet page The function returns a boolean value and is as follows Function IsAltered(strMode) ' This procedure ch...

Wpf custom control

I have a customn control which display a window with another custom control inside. The developper can redefine the control template, it works but I don't find a way to allow developper to redefine the template of control inside the window that the custom control display... ...