Given the very simple wpf app
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="800">
<Grid>
<ToolBar Height="50" >
<MenuItem Header="Test1" />
<MenuItem Hea...
Hi folks,
I am currently using a Linq template with SubSonic3 to create my models. I have a simple Member class, which has a collection of Notes. A Note class has a PublishedDate and Title properties.
I have a UserControl which has a collection of Members for its DataContext. There are two ListBoxes and a bunch of TextBoxes and other c...
I have 2 ItemsControls parallel to each other. The first is a set of TextBlocks with Property names and the second is a set of TextBoxes with Property values.
Property1 Value1
Property2 Value2
Property3 Value3
" "
The list goes on very long in some cases.
Is there a way to possibly break the columns at a certain poin...
I’m struggling a little bit with some XAML syntax I hope someone can advise on. I want to create an “Effect” type style resource which contains a DropShadowEffect definition which can be reused rather than always manually setting the properties. Here’s what I have:
<Style TargetType="DropShadowEffect" x:Name="DropShadowEffectStyle">
<...
I have the following WPF application
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication1"
Title="Window1" Height="300" Width="300">
<Grid>
<TabControl>
...
I'm trying to set the width property of one of my controls to a qualifiedDouble,
as described here on MSDN.
(Scroll down to the "XAML Values" section to see MSDN's info on the use of a qualifiedDouble)
However, I want to know how to achieve this in the code-behind, rather than XAML. The UserControls I am creating do not have XAML atta...
Hello,
I have some xml:
<Response TaskId="2429">
<message>Run for cover.</message>
<element location="proj\survival.cs"/>
<element location="proj\run.cs"/>
</Response>
I would like to add an attribute to each item:
<element location="proj\run.cs" status="running"/>
Is that possible with LINQ in C#?
Thanks any tips...
...
I need to sort the strings in a ListBox, but it is bound to the view model by another component via the DataContext. So I can't directly instantiate the view model in xaml, as in this example, which uses the ObjectDataProvider:
http://www.galasoft.ch/mydotnet/articles/article-2007081301.aspx
in my xaml:
<ListBox ItemsSource="{Binding ...
I have a static class which contains a RoutedUICommand that I would like to use in binding.
public static class CommandLibrary
{
public static ProjectViewModel Project { get; set; }
public static RoutedUICommand AddPage { get; private set; }
static CommandLibrary()
{
AddPage = new RoutedUICommand("AddPage", "Ad...
So, the web, and StackOverflow, have plenty of nice answers for how to bind a combobox to an enum property in WPF. But Silverlight is missing all of the features that make this possible :(. For example:
You can't use a generic EnumDisplayer-style IValueConverter that accepts a type parameter, since Silverlight doesn't support x:Type.
Y...
I have 2 Xaml files, one containing a DataTemplate which has a resource definition for an Image brush, and the other containing a content control which presents this DataTemplate. The data template is bound to a view model class. Everything seems to work EXCEPT the ImageBrush resource, which just shows up white... Any ideas?
File 1: D...
The scrollviewer below does not work. I tried everything I could find on this site and beyond: embedding the scrollviewer in an Grid, embedding the ScrollViewer's children in a grid, embedding the Scrollviewer in a StackPanel with fixed height, setting/binding the height of the scrollviewer, all to no avail... Who shows me the way back t...
Hello. I'm trying to build a Silverlight application where I use 5 XAMLS.
The first one, "Page.xaml" contains a menu with 4 buttons and a Canvas to receive the each content XAML. Each Content XAML has 2 storyboards: "entrada" (the "enter section" animation) and "saida" (the section ending animation).
I am experiencing the following pro...
Hi,
The following code is part of a small XAML application that displays data in a tabular form. Basically I need to translate this code into C#.
<Grid Width="768" Height="1056">
<Grid.RowDefinitions>
<RowDefinition Height="114" />
<RowDefinition Height="906*" />
<RowDefinition Height="36" />
</Grid.RowD...
In XAML, how do I put a standard dividing line in a menu?
eg
<MenuItem Header="_File" Name="m_fileMenu">
<MenuItem Header="_Open" Command="ApplicationCommands.Open"/>
<!-- Trying to put a divider here! -->
<MenuItem Header="-" /> <!-- Wrong guess -->
<MenuItem ...
Hi all, may you happy every day
I am new in silverlight
Suppose I am writing a user control(name as AAA.xaml) which contains a DataTemplate, in which I want to have another user control's(defined in BBB.xaml) instance by data binding.
I initilize a instance of BBB user control(name as bbb) in AAA.cs(the c# file of AAA.xaml), and I wan...
Hi all,
My mouse wheel does not work when putting a ListBox in a ScrollViewer.
Does the ListBox somehow "steal" this event?
<ScrollViewer VerticalScrollBarVisibility="Auto" Style="{StaticResource myStyle}">
<ListBox>
<ListBoxItem>Test 1</ListBoxItem>
<ListBoxItem>Test 2</ListBoxItem>
<ListBoxItem>Test 3</ListBoxItem>
<ListBoxIt...
I have a data object -- a custom class called Notification -- that exposes a IsCritical property. The idea being that if a notification will expire, it has a period of validity and the user's attention should be drawn towards it.
Imagine a scenario with this test data:
_source = new[] {
new Notification { Text = "Just thought you ...
So you've got a usercontrol. You would like to bind to some of its dependency properties, so you need specify an x:Name in order to use it.
You can't do this...
<UserControl x:Class="WpfApplication1.UserControl1" x:Name="UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="h...
I have the following XAML that displays a cover image for a book using a URI:
<Rectangle.Fill>
<ImageBrush ImageSource="{Binding CoverUrl}" />
</Rectangle.Fill>
However, the image I would like to use is not on disk anywhere or accessible via a URI; it comes from inside a binary file that I parse out into a BitmapImage object.
Whe...