I feel like I've missed something obvious, but when creating a custom control in Silverlight I can declare properties as public and they will be exposed when making XAML declarations, so I can easily do something like this:
public class MyControl : UserControl
{
public string Title {get; set;}
}
And this:
<local:MyControl Title="...
I have the following xaml to show a rotating ellipse:
<Ellipse x:Name="ellipse"
Stroke="{StaticResource _SpinnerGradientBrush}"
StrokeThickness="20"
RenderTransformOrigin="0.5,0.5"
>
<Ellipse.RenderTransform>
<TransformGroup>
<RotateTransform Angle="0" />
...
I have a ContentControl comprised from left to right of a Button, partition and a ComboBox. I want the ComboBox dropdown to line up with the left side of the control as opposed to the left side of the combobox. I received a method in code but I was wondering whether if it could be accomplished in xaml.
This gives me the name of the con...
How can the whitespace at the start and end of the content of an XML element be removed when binding to the element using XPath in WPF?
...
As an example, if I have an element whose size I want to be twice the size of another element, how would I achieve this?
An example would be the following, mirroredObject is the object that I want to use half of it's width for the width of the Border object.
<Border Width="{Binding ActualWidth, ElementName=mirroredObject, Mode=Default}...
We have an application that will be reading real world dimensions from the DB in milimetres, these values will then be presented to the user in WPF. Currently I'm using the following strategy when reading objects from the data store by multiplying MilimetresPrWpfUnit in the following example.
public const double MilimetresPerInch = 25.4...
I am creating some wpf resourceDictionaries whit all the styles for an application! I have a few LinearGradientBrush'es, where the color is set directly in the LinearGradientBrush reference as GradientStop's. However, I want to have a predefined set of colors that I can use a a reference for each GradientStop, so that changing the color ...
Hey
I have an Ellipse defined as so
<Ellipse Stroke="#FF474747" Style="{StaticResource SelectedTemplate}" Fill="{StaticResource RedGradient}" />
I also have two styles setup like so
<RadialGradientBrush x:Key="RedGradient" GradientOrigin="1,1">
<GradientStop Color="White"/>
<GradientStop Color="Red" Offset="1"/>
</RadialGrad...
I have a WPF assembly in which I would like to embed five icons for different filetypes associated with my application.
How can I embed these icons into my EXE?
@smoore @Groky @ChrisF, thank you.
Unfortunately, this is not what I asked. I see that my question was quite vague 0_°. Let me rephrase the question:
I have icons, say App...
I'm using VS2008 EE SP1 + WPF + XAML.
In the beginning I added a reference to it:
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
I'm getting this error while compilation:
<vsm:VisualStateManager.VisualStateGroups>
<vsm:VisualStateGroup x:Name="CommonStates">
<vsm:VisualStateGroup.Transi...
I currently have an app (in Silverlight), using mv-vm, that has an interface to add/edit/remove various entries to a database. A good analogy would be a page for ordering a car with many checkboxes and comboboxes for whatever features you wanted the car to include.
My app has many of these UI elements (even including TreeViews with Tree...
I've got my DataContext set to a Book object. Book has properties: Title, Category.
I've got a CollectionViewSource "categoryList" that holds a list of Categories.
Question: How do I select the book's Category in this combobox?
<TextBox Text="{Binding Path=Title}"/>
<ComboBox SelectedValuePath="Id"
SelectedValue="{Binding...
Apologies for the ambiguous title.
I want the items of my listbox to display similar to a photo gallery - imagine Thumbnail view on Windows File Explorer.
I have a listbox defined as so
<ListBox ItemsSource="{Binding RUFView}" x:Name="RUFs" Margin="228,34,12,12" Background="Transparent" BorderBrush="#007F9DB9">
<ListBox.ItemsPanel...
I have the following stack panel
<StackPanel>
<TextBlock Text="{Binding AddressLine1}" />
<TextBlock Text="{Binding AddressLine2}" />
<TextBlock Text="{Binding AddressLine3}" />
<TextBlock Text="{Binding AddressLine4}" />
</StackPanel>
and my AddressLine2 string is null on the bound object.
My stack pane...
I have a Grid inside a ScrollViewer inside a Border inside a StackPanel inside a Window.
The ScrollViewer puts a scrollbar on the right, but it is not scrollable.
How can I get the ScrollViewer to make its contents scrollable?
<Window x:Class="TestScroll234343.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presenta...
I have a 27 x 27 pixel image that I am displaying in WPF but it displays larger than the size of the window.
How can I get it to display its actual size?
XAML:
<Window x:Class="TestImage23434.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
...
I'm using WPF with the Model-View-ViewModel pattern. Thus, my code behind files (.xaml.cs) are all empty, except for the constructor with a call to InitializeComponent. Thus, for every .xaml file I have a matching, useless, .xaml.cs file.
I swear I read somewhere that if the code behind file is empty except for the constructor, there ...
I want to make bubble of text appear when the mouse is over a TextBlock.
The following code is the closest I can get but it just injects text into TextBox.Text itself and changes the color. I want to have a e.g. Border/StackPanel/TextBlock above the original textblock floating on a different layer during mouseover.
How can I make a hov...
How can I make the Tooltip in the following code display faster?
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace TestHover29282
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
TextB...
Silverlight does not feature DataTriggers, so in this case... what might be the best way to conditionally set the fontweight of an item to a boolean?
For example... the following is not possible in Silverlight.
<TextBlock Text="{Binding Text}">
<TextBlock.Triggers>
<DataTrigger Binding="{Binding IsDefault}" Value="True">
...