xaml

Silverlight media player

Hello everyone, I am using VSTS 2008 with C# to develop Silverlight application embedded in web page of an ASP.Net web application. I have embedded in XAML a MediaElement item. My question is, I want to embed the page a Silverlight media player, which could let end user to control the MediaElement item manually to -- play/pause/stop/rew...

Is there an automated way to remove XAML default properties?

Are there any automated tools that will parse through XAML code and clean out values that are explicitly declared to their defaults? Example: <Grid Margin="0,0,0,0" Height="Auto" Width="Auto"> I would expect to be reduced to: <Grid> ...

Why does my databound TabControl not look like my non-databound TabControl?

My non-databound TabControl looks fine: <TabControl Width="225" Height="150"> <TabItem Header="One"> <TextBlock Margin="10" Text="This is the text block"/> </TabItem> <TabItem Header="Two"/> <TabItem Header="Three"/> <TabItem Header="Four"/> </TabControl> But my databound TabControl looks like this: <W...

Embed Icon in WPF application.

I am using an icon in my application in two situations. In XAML as an Image for the Button using DynamicResource. In C# as NotifyIcon this.notifyIcon.Icon = new SystemDrawing.Icon("..//..//Shutdown.ico" ); My problem is if I delete the image the application not working. How can I bind the image with the exe file so that the applic...

Bolding individual lines in a databound listbox

Hi, I have a listbox whose itemssource is databound to a list of ints. I'd like to bold bold a few of the items, on the basis of their value. There are two options that come to (my) mind: 1) Use datatrigger that bolds the value if it's a match. 2) Use a class to wrap the ints and pair each int with a boolean that denotes if the value ...

Can you define an storyboard to play out, before a property changes?

For instance I am setting the Visibility on and off for a certain element. I have a Trigger that listens to the Visibility being set to Visible and plays out a Storyboard that fades in the element. So on the flip side, when the element is set to Hidden, I want the element to fade out, and then have the property set to Visibility = fa...

How to derive a new class from DataTemplate and then use it in place of DataTemplate?

How do I derive a new class from DataTemplate and then use it in place of DataTemplate? For example, in C#: public class DerivedDataTemplate : DataTemplate { } Then in XAML: <local: DerivedDataTemplate DataType="{x:Type local:SomeType}"> <Grid> ... UI here ... </Grid> </local:DerivedDataTemplate> When I try to use ...

Setting Data Property in Silverlight Path Style

I am trying to put as much properties of a Path element into a Style, this works out ok, as longs as I don't add Data to the Style setters: <UserControl x:Class="Demo.Controls.SilverlightControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width=...

Why can't I bind the BeginTime property of this animation?

So I have a control template that looks a bit like this <ControlTemplate TargetType="{x:Type local:OptionCheckBox}"> <Grid>...</Grid> <ControlTemplate.Triggers> <Trigger Property="Visibility" Value="Visible"> <Trigger.EnterActions> ...

UpdateSourceTrigger=PropertyChanged and Converter

Hi, I have a simple converter that adds a "+" symbol to a positive number that is entered in a TextBox. When the number is entered I want to initiate some action, but I don't want to wait until the TextBox loses focus: I want to update the binding immediately as the user enters the text. The default behaviour of a TextBox is that when ...

Are there any good documents or websites that show design guidelines for XAML GUIs?

I am looking for some guidelines or standards for XAML GUI design... or even a very good set of examples that show nice GUI that I can use as a starting point. Over the years I have grown into a very good Battleship Grey Dialog designer, but those are old, and ugly now... and I need to revamp a couple of product GUIs. I know with XAML...

XAML in Database - Getting Very Meta

How would you go about making an application that can edit it's own look and feel? Can tweak its own XAML files? then reload them. I'm thinking a notepad-like text editor, not a visual designer. All the event/code would be bound right after display from an "iron" scripting language. ...

WPF: Dynamic MarkupExtension- ReRendering/Updating of value

Hey everyone, I´m using a markupextension for loading internationalized strings in a WPF application like this: <Button Content="{Translate MyText}"/> My markupextension is named "TranslateExtension" and it searches a value for the key "MyText" from a database. It does this in the ProvideValue(IServiceProvider serviceProvider) me...

Setting the ItemsSource of a combobox from an INDEXER in XAML???

I have a cache that retrieves collections based on a string (collection name) passed to the cache (ie... GlobalCache.Instance["States"]) I added a resource as following: < EnumCache:GlobalCache x:Key="GlobalCache" /> then the control.... <dataControls:DataFormComboBoxField x:Name="cmbStates" ItemsSource="GlobalCache.Instance['...

Whatever happened to Adam Nathan's XAML Playing Cards?

I'd like to see the code samples for Adam Nathan's Playing Cards demo he did in XAML. However, none of the links point to anything valid any more. Does anybody have the sample code, or have a link to it that works? Cheers, Mark ...

Non-fatal XAML exceptions

When I do something illegal in XAML, e.g. binding to a non-existing source all exceptions are silently handled and logged to the output console. I like to have these in a log file, in case this happens when this occurs when my application runs at the customer. How can I do this? ...

Sequentially animate items in an ItemsControl

So as a simple example, if you have an ItemsControl like the one below which dynamically creates it's contents How could i add triggers so that each item animates in and has a BeginTime based on it's index in the list. I've tried extending the button so that it contains a delay time and then binding the BeginTime of the animation contai...

Designing data templates for WPF

Using WPF, XAML, VS2008, and Blend 2 (or 3 Beta preferred), what is your process for creating data templates? Do you have a process for testing the data template's appearance WITHOUT spinning up your app just to test how the data looks? Is there a process I can use in Blend to make developing data templates more graphical? ...

Why won't StackPanel put textblock on left and button on right in Silverlight?

OK, I give up: what do I have to change to this StackPanel below so that it puts the: text on far left of form button on far right of form. <UserControl x:Class="TestData333.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" H...

Setting a style's TargetType property to a generic class

Is it possible to set a style's TargetType property in XAML to a Generic Class? public class Selector<T> : Control { } and then in xaml <Style x:TargetType="Selector"> <Setter Property="MyProperty" Value="Green" /> </Style> This wont work because Selector is missing a type argument. ...