xaml

WPF - Mixing style defined in dictionary with style defined in parent control

I define custom look for Button control in resource dictionary: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Style TargetType="Button" x:Key="BaseButtonStyle"> <Setter Property="Background" Value="Blue"/> </St...

How to add a new record to database from XamDataGrid

Hi, I am using a XamDataGrid to populate say books. I want to ADD/EDIT/DELETE books from XamDataGrid and the change should reflect in the database. i.e. when I edit the record in XamDataGrid changes should be stored in the database similarly for Add and Delete. Can anyone please give me sample code or explanation how to achieve this? I...

WPF: How do I set the content of a Paragraph in Code?

I've got a FlowDocument and assigned a name to one paragraph. I want to edit the content of a paragraph (which is just one ordinary string btw.). How to do this? ...

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 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...

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...

Select Multiple Items in CustomPivotViewer of Silverlight

I'm thinking of CTR-Clicking each item to build up an array to add.... or even more fancy, drag select an area of items (don't think this is possible tho). I'm aware of the custom events such as ItemDoubleClicked, but is there something like ItemSingleClick, where I can check if the CTR/SHIFT key is being pressed before executing an act...

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 ...

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...

XAML: Rounded corners for all Images inside a FlowDocument!

I want to give all images inside a FlowDocument rounded corners. Whats the easiest way to achieve this? ...

[WPF] Creating a hierarchical ContextMenu using DataBinding

Hi, i'll try to create a hierachical context menu using databinding. The XAML code looks like the following: < ContextMenu> < MenuItem Header="MoveTo"> <MenuItem.Resources> <!-- Display files as menu items --> <HierarchicalDataTemplate DataTy...

How to group controls inside Grid for reuse in XAML?

In my application I have some controls that logically belongs together and is reused many places in different windows. The controls are always placed inside a grid. Instead of copying the controls (and the code behind) each time I want to use them, I would like to define and maintain them in a single xaml file as a single UserControl. ...

Can I add and run a new XAML only workflow in Sharepoint 2010 during runtime?

I would like to create XAML-only workflow then "upload" it to Sharepoint 2010 and manually execute it as I would run it in Windows Workflow Foundation. So far I know I can package my workflow and deploy it as WSP to Sharepoint and then start it either manually or on an event trigger, but this scenario doesn't suit my needs unfortunately...

WPF ComboBox does not show current item when it is a DependencyObject

I have this very simple Combobox in my XAML: <ComboBox Name="cmb1" Width="200" Height="23" ItemsSource="{Binding}" /> and this is my code behind: public class Test //: System.Windows.DependencyObject { public string Name { get; set; } public override string ToString() { return Name; } } public MainWindow() { InitializeC...

How to get a resource from a merged ResourceDictionary in a code-behind file?

I have a custom look-less control derived from Control class. It's template is defined in Generic.xaml file. Now I want to add some UI stuff to it (mostly brushes) and want to do that in separate resource dictionary, and then access those stuff from the code-behind feil (*.xaml.cs). See bellow: Generic.xaml (fragment): <ResourceDiction...

How do I set a code object as the DataSource for a ComboBox, using XAML?

Hi, I've started a new job this week and am trying to get my head around this WPF stuff. I've gotten to a point where I'm trying to add a ComboBox to a UserControl, and to populate it from a collection which exists in code. I've been getting along pretty much on monkey-see-monkey-do coding for the most part; copying and adapting existi...

Writing <period> in my TextBox should perform tab

When I write a <period> into myTextBox I want a myOtherText.Focus to be performed. Anyone know a way of doing this in xaml code? Edit:Agree that the orginale solution I asked for was a little hacky. So I changed the question. :) ...

IsMouseOver returning False when over a ContextMenu or Validation Error?

I have a control which expands when IsMouseOver is set to true using a trigger. Within that control, there is some textboxes that have some basic validation. My problem is that when a validation error occurs and the user mouses over the Red border around the textbox (almost guarenteed to happen as user moves the mouse to center of textbo...

How to access Generated WPF controls after Data Binding

Please consider the following XAML code: <ListBox Name="listBox1" ItemsSource="{Binding}" > <ListBox.ItemTemplate> <DataTemplate> <Border Name="border1"> <TextBlock Text="{Binding}" /> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox> and we assign a simple arr...