I'm trying to create a UserControl that inherits from a generic class. It does not directly inherit from a generic class, but through an intermediate class that does not use generics. This compiles and works at runtime, but I get an error at design time.
Here's my generic parent class:
Public Class GenericParent(Of T)
Inherits Us...
I've been doing some WPF development for the last few months, and I've recently started Silverlight development.
Most of the time things go OK, especially for the simple stuff, but frequently I get stumped by seemingly simple things - especially in XAML. As an example, yesterday I was trying to use a Grid to lay out the items in a ListB...
I have a custom template for an expander that is close to the code below. I had to change some of the code to take out custom classes, brushes, etc..
<Style TargetType="{x:Type Expander}">
<Setter Property="HorizontalContentAlignment"
Value="Stretch" />
<Setter Property="VerticalContentAlignment"
Value="Top" />
...
I have a C# (2008/.NET 3.5) class library assembly that supports WPF (based on http://dotupdate.wordpress.com/2007/12/05/how-to-add-a-wpf-control-library-template-to-visual-c-express-2008/). I've created several windows, and am now attempting to create a common style set for them. However, as it's a class library (instead of a WPF app), ...
I just wanted to do some tutorials in WPF but I find that the designer works very slow in comparision to Windows Forms/GDI+.
Are there any tweaks to speed it up?
...
i created a wpf custom control with a dependency property of an enum type.
i want the user of that control when editing the xaml in vs to see the optional values of the enum in the intellisense window.
does anyone know how it can be done?
...
I need to bind the column Header text of a DataGrid to a Resource string in a XAML file. Does anybody know if this is possible ?
The column Header definition looks like this but I would like to replace the "MyHeaderText" with text from a resource file:-
<data:DataGridTextColumn Header="MyHeaderText" Binding="{Binding SomeData}" IsReadO...
Can someone explain the syntax in the source attribute here? What the heck is "pack:" and "application:" and why 3 commas? I couldn't find any decent desciptions.
...
I have the following DataTemplate in a Listbox
<ListBox Grid.Column="1" Grid.Row="2" ItemsSource="{Binding People}" SelectedItem="{Binding SelectedPerson}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock OverridesDefaultStyle="True"
Background="{x:Null}"
Margin="0"
Padding="0"
IsHitTestVisible="True"
T...
I have a complex WPF UserControl made of other ContentControl templates which contain sets of buttons, textfields, and other elements.
The parent UC is focusable so I have a style with a property trigger to update (gratuitous OuterGlowBitmapEffect) when the UC has focus. However when the user clicks or tabs to any of the buttons inside ...
Is there a viewer object or ActiveX control I can use to embed an XPS document, or an XAML GUI in my .NET application?
...
Can I dynamically create an XAML and pop it into my app? How would it be done?
...
I'm taking Silverlight XAML and sending it to a web service that renders the XAML in a STA thread and generates a PNG image. All the XAML renders correctly except the <image> entries which 'appear' to load correctly when their Source property is set in WPF but the PNG does not show the referenced image - what am I doing wrong ?
The core...
I have a simple ControlTemplate for buttons which creates a link-like look and feel for them:
<ControlTemplate x:Key="LinkTemplate" TargetType="{x:Type Button}">
<TextBlock Text="{TemplateBinding Content}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Va...
Hi,
I have implemented a UserControl and put a TreeView control on that. The XAML file looks as follows. I am using a HierarchicalDataTemplate for data binding with the Treeview,
<UserControl x:Class="Trinity.Windows.Viewer.Alarm.AlarmPage.TrinityDeviceTree"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xml...
Hi,
I have implemented user control and put TreeView control on that, XAML file looks as follows
I am using HierarchicalDataTemplate for databinding with Treeview,
<HierarchicalDataTemplate DataType = "{x:Type src:Partition}"
ItemsSource ...
Is there a XAML to C# conversion tool?
I have a control template defined in XAML, but I want to create this template and it's styles using C#, so I can obfuscate the code version (since I can't obfuscate the XAML/BAML).
...
I'd like to bind to a value reachable only with XPath from the property of an element.
The element is a ComboBox populated from some XML, and its property is SelectedItem. SelectedItem points to an XML element, and I'd like to bind to a child element's value within that, which can be reached with an XPath.
The XAML looks like this, so ...
I have created a very simple test app to try and solve this problem described to me by a co-worker. He was able to trigger it in C#, but I believe he needed the solution to be more generic and wanted it to be done strictly in the XAML. The problem was: How do you trigger the Storyboard inside of a UserControl to begin in response to an...
I'm wondering how one could use template databinding to accomplish what the following code produces (a grid of checkboxes with some associated text):
int tbIndex = 0;
for (int i = 1; i < 5; i++) {
StackPanel pan = new StackPanel();
pan.Orientation = Orientation.Horizontal;
pan.Margin = new Thickness(3);
pan.Name = "RowP...