I have a ListBox control in WPF which contains items of variable height (predominantly a large text block, so it's also affected by word wrapping). Since scrolling behaves badly when the height of an individual item gets too high (especially when close to the height of the ListBox itself), I want to constrain the max height of the indiv...
I am trying to build the following DataTemplate in C#
<DataTemplate x:Key="lbl">
<!-- Grid 2x2 with black border -->
<Border BorderBrush="Black">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefin...
Hi
This might be more of an outcry, but building DataTemplates in Silverlight code seems to be impossible. The one option I am aware of being using XamlReader.Load(string), one is met with several issues using this approach:
No validation, everything is done in concatenated strings. We all know this sucks
Any necessary resources have ...
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...
Judging from the lack of info around, I'm guessing the following question maybe a little "off piste" as they say..
I am trying to find an XML based javascript (pref. JQuery based) templating engine..
A little like say how Ext.JS (Sencha) do things, or SPRY datasets. Something lite..
Obviously there are lots of JSON based ones, and f...
Context
I'm putting together a templated, databound control. Presently it works with the following syntax...
<cc:ItemChooserControl ID="ItemChooser" runat="server">
<TitleTemplate>
<h4><%# DataBinder.Eval(Container.DataItem, "DisplayName") %></h4>
</TitleTemplate>
</cc:ItemChooserControl>
Problem
What I would like t...
I have been using ItemsControl for quiet sometime in WPF. I am using MVVM for developing my application.
Now I have run into a problem. I have a requirement where in based on number of values in a IList<> , I have to display the number of TextBoxes separated by a comma in between. I have written an ItemsControl which iterates over the b...
<DataTemplate x:Key="tmpGrdProducts">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
...
I am trying to format a ToolTip in a ComboBox. The following XAML is correctly picking up the value needed for the ToolTip, but not the DataTemplate.
<DataTemplate DataType = "ToolTip">
<TextBlock Width = "200" TextWrapping = "Wrap" Text = "{Binding}" />
</DataTemplate>
<Style x:Key = "RadComboBoxStyle1" Targ...
In my user interface I sometimes want to put titles above usercontrols.
I want to declare these titles in XAML for future localizability, so I want to keep them out of the datacontexts.
Can databinding fetch them from a property set on the root node of the usercontrol?
I have boiled the problem down to the following code example:
usi...
I am working on an application where Repository objects are displayed via a DataTemplate that contains a modified version of a TextBox, which supports binding to the SelectionStart, SelectionLength, and VerticalOffset.
The DataTemplate looks like this:
<DataTemplate DataType="{x:Type m:Repository}">
<controls:ModdedTextBox
x:Name="tex...
Hi, I have a textbox that has the following simple XAML (not necessary to read it - just have it for reference):
<TextBox Name="m_ctrlUserDeviceType" Style="{StaticResource textStyleTextBox}" Text="{Binding Source={x:Static api:MySettings.Instance}, Path=UserDeviceType, ValidatesOnExceptions=true, NotifyOnValidationError=true}" Validati...
I have a Button in a DataTemplate that is bound to a Command in my ViewModel. The button also has an EventTrigger that kicks off a Storyboard that hides the edit controls (of which the button is a part.)
The Storyboard works fine if I pick up the PreviewMouseDown event, but the Command never gets called. If I pick up the MouseDown event...
I know its strange what I am doing but I want this to work. I am going wrong somehwere I feel.
I have a DataTemplate defined in my resources as follows :
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../ParameterEditorResourceDictionary.xaml"><...
I have a resource dictionary as follows defined in my UserControl:
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../ParameterEditorResourceDictionary.xaml"></ResourceDictionary>
<ResourceDictionary>
<DataTemplate x:Key...
I've got a combo box, which allows user to select the FontFamily for some control. The combo box is populated using FrameworkElementFactory, which essentially creates a text box for each font family. Each text box print the font family name, using that font typeface. The combo box data is tied to the Fonts.SystemFontFamilies for the list...
I have a WPF application using a TabControl bound to a collection of the MyTab class. Each TabItem has a ListView bound to the Items property of the MyTab class.
My problem is that scrolling up or down in any ListView is affecting the position of all the others.
XAML:
<Window>
<Window.Resources>
<DataTemplate x:Key="TabHeaderTem...
I'm learning the ASP MVC2 framework, with no prior knowledge of MVC1. At the moment I'm constructing a toy website for learning purposes.
So far I've been primarily using Html.RenderPartial as my main means of organizing view rendering. In theory I'd prefer something less imperative and more declarative.
I've read several tutorials on ...
I have two DataTemplates for different cells in my Treelistview control.
the templates are 90% similar.
How can I reuse the identical Xaml ?
<DataTemplate x:Key="@names">
<TextBlock Name="txt" Text="{Binding Names}" Style="{DynamicResource @BasicTextBlockStyle}"
Foreground="{Binding RelativeSource={Rela...
When you add a Click event throws System.NullReferenceException.
<ListBox DockPanel.Dock="Top" DataContext="{Binding idPerson, Converter={StaticResource ConvertTrainersFromClientsKey}}" ItemsSource="{Binding}" >
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel>
<Button Content="{Binding name_trainer}" Tag="{Binding idPersonTra...