Hi,
I'm using a binding of the form
{Binding RelativeSource={RelativeSource Self}, Path=Children.Count, Converter={StaticResource CountToDimensionConverter}, ConverterParameter=Rows}
Despite adding the children in xaml, when I break in the converter, the value is always 0.
What I assume is going on is that the children are not adde...
I'm just playing around with WPF at the moment and I don't entirely understand how it works, but this is baffling. I have a piece of code which creates a TextBlock with a RenderTransform and animates it scrolling across the screen. This is pretty much a procedural translation of something Josh Smith wrote to demonstrate how you might do ...
I have a textbox inside a Expasnders contentemplate that I'm trying to bind to from outside the expander, but it's not really possible, I have another textbox inside the expander looking like this:
and an exact duplicate of this markup outside the expander, The textbox inside the expander updates it's text proeprty when txtTitle is ch...
It's probably doable, but with my n00b skills I couldn't figure this out yet.
When I try to "Make Into Part" on the RadMaskedTextBox, Expression Blend complains that it's not a TextBox.
How can I make it to use it as a proper control part? Can I "typecast" somehow in XAML?
Thanks in advance for all help!
...
Im trying to make my own ControlTemplate for an menu. Id like to turn the corners of some items to the outside. So that it look like the Word TabItems, i cant post an image im sry. But i hope you understand what i mean.
Is there a possibility to change the cornerradius like that? or are there other possibilitys?
regards
Mark
...
My goal is to have exandable sections in a flow document. This XAML works, BUT
1- if you change the root from grid to stackpanel the scrollbar no longer works.
2 - Exand section 1. Scrolldown and you'll see the Toolbar at the bottom and Section 2 below that - even tho IsToolBarVisible="False".
Perhaps I need to structure the FlowDocum...
Is there a way to calculate the Area and Volume for a given GeometryModel3D?
...
I know that events in WPF bubble up the visual tree, so I don't understand why this simple example of catching the event of a context menuitem click event on it's parent listbox doesn't work:
<ListBox Width="200" MenuItem.Click="MenuItem_Click">
<ListBoxItem>
<TextBlock Text="Hello">
<TextBlock.ContextMenu>
...
Simple case:
<usercontrol>
<Views:UserListView x:Name="settingsTreeView"/>
<Button DataContext="{Binding ElementName=settingsTreeView, Path=SelectedItem}"
Command="{Binding CreateChildCommand}"/>
</usercontrol>
The task just is to bind to button a DataContext which implements CreateChildCommand.
DataContext is the sel...
Hi
I think I have a pretty simple goal but cant seem to reach it.
All I want to achieve is to have a ItemsControl (because I don't want the selection functionality of a list) with a header. Preferably a static header.
Currently I'm using a grid for the header and then copying that grid into the ItemTemplate (DataTemple) of the ItemsCo...
How can I customize the menu to the situation in WPF?
I have a main window with a basic menu. In this window, I can load different UserControls and then I want the menu to be expanded with different menu options depending on which User Control is used.
In addition, I wonder how I add a MRU.
Example:
Main menu:
File
Open
-
MR...
Ive created a custom UserControl that contains a single combobox. The currently selected value in the combobox is bound to the custom UserControls Dependency Property.
XAML:
<UserControl>
<ComboBox
ItemsSource="{Binding AllEntries}"
SelectedItem="{Binding SelectedEntry}" />
</UserControl>
Code behind:
public part...
I am dynamically building my datatemplate using XamlReader.Parse(string). The problem I have is that I can't put any events on any of the controls I create using the XamlReader. After doing some research online I've learned that this is a known limitation of XamlReader.
I don't know a lot about commands in WPF but could I somehow use t...
I'm getting an "Object reference not set to an instance of an object" error when I try to reload the Designer for my XAML UserControl. Visual Studio highlights the following line as being the problem:
<local:TemplateDetail Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"
Width="600" TemplateData="{Binding ElementName=cbo_templates,...
Hi.
I'm building a program in WPF which must feature multi-language support, with the ability to switch language at run-time. My question concerns the image part of the localization.
I've built a solution which does not work the way I had hoped it would work and I would like some help fixing these problems. The code posted below is onl...
If I have a Style inside Generic.xaml and I want to reference a style within the SAME Generic.xaml file why does it not work?
<Style TargetType="{x:Type w:SomeControlIWantToStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type w:SomeControlIWantToStyle}">
...
i know HTML/CSS and want to learn WPF styling. how can i get started. i see that padding, for example, works differently in WPF app.
in css:
padding: 5px 10px;
in XAML?
Padding="5px"
i notice that i need to expand the width of the element eg. button myself to accomodate the padding? if so, how can i calculate the box model? the...
Hi, I have been trying for a day now, to no avail, to create a bunch of brushes in the theme then using them with DynamicResource in a custom control. What I did is this:
create the theme generic.xaml which contains styles (works)
add a dictionary to merge in generic.xaml to contain brushes used in the application (works)
make brushes ...
when do i use each of the following?
{Binding ElementName=...}
{Binding Source=...}
{Binding ... Path=...}
<TextBox DisplayMemberPath=...}
// and i think i saw something like ...
{Binding xxx}
i also wonder if there are any other ways of data binding i need to be aware of? i am new to C#/WPF
...
How can I select multiple items from the listbox in a windows phone 7 application?
e.g
listboxName.SelectedIndex = 0;
listboxName.SelectedIndex = 1;
listboxName.SelectedIndex = 2;
The above code selects 2 while I need to select all three of those.
The values I need to preselect are given to me in a array like
{true,true,true,false,fa...