xaml

Silverlight Without XAML - Images Will Not Render

I have a Silverlight application in which I'm not using XAML. I have a basic application with the following code in Application_Startup: private void Application_Startup(object sender, StartupEventArgs e) { Grid g = new Grid(); g.Children.Add(new Image { Source = new System.Windows.Media.Imaging.BitmapImage(new Uri("http://ss...

How to do something like a screensaver in my WPF-Application?

Hi, I have an WPF-Application with 3 different UserControls in the MainWindow and only one of these is visible at the time. It's like having 3 different pages and you able to switch from one page to another when you like it. First page is like a start-screen. Second is like the "general view". And the third page shows details. Switchin...

WPF Image UriSource and Data Binding using http:\\ URL

I am having a problem displaying an image with a web URL in a WPF user control. I have worked through all the suggestions for a similar problem asked on this site in Aug 2008 (http://stackoverflow.com/questions/20586/wpf-image-urisource-and-data-binding) but none of those suggestions have worked. What I'd like to do is: <Image Width="...

Problem with GridSplitter not resizing content

Hi, First off I'm new to XAML so forgive me if I've done something stupid. I have stripped down my page to the following example XAML (viewable in XamlPad): <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xam...

How to Automatically Use a DataTemplate Based on ControlControl's Current Content's DataType

When I attempt to specify multiple DataTemplates for use by a ContentControl so that the correct one (based on Type) is used, I end up with Content that is simply the Content's ToString() value. <ContentControl DataContext="{Binding MyTreeRootViewModels}" Content="{Binding /, Path=CurrentlySelectedTreeViewModel}"> <ContentControl.Reso...

Can I toggle expandability of a expander?

Is there any property or state I can set on a expander object that makes it unexpandable but still can be selected? I'm thinking for example of the last Child in a TreeView where I don't wan't the Expander to have an expander button. But other uses could be if someone doesn't have access to more then the header or something along that l...

Scrolling a TextBlock

Hey everyone, I have a TextBlock and a Textbox in the same location. Depending on what mode the user is in, I make one visible and the other collapsed. This is working fine, but how can I make the Textblock scrollable? I figured I should use a ScrollViewer, but I don't know why it's not working. I've tried messing around with the heigh...

Styling dynamically added StackPanel child elements

Hi, I have a StackPanel that I dynamically change the contents of every 5 minutes to show the user messages. These messages are displayed as TextBlock or HyperLinkButton. I'm wondering how/if I can set a style within the StackPanels style that will apply to the children. E.g. I've tried <Style x:Key="InfoBarStyle" TargetType="StackP...

How to reference an icon resource file reference in XAML

Hi Folks I'm trying to get a button to display an icon in XAML. Initially I wanted to paste a character instead, but vb Express 2008 would not recognise it being a symbol as it is not a regular character. Then I created an icon and tried to set the button image property to reference it, but this does not exist, so more misery. Now I've ...

How to set a Trigger on a child to a parent property?

I have a TreeView with a ToggleButton ( ExpanderButton ). The togglebutton has a two images ( one for expanded and one when not ). However when I select a TreeViewItem I highligh it with a different color and I'd like to change the color of the images as well ( I have the same ones in the other color ). Problem is I don't know how to se...

Question about this xaml markup extension

Hi, I'm trying to understand what does the markup extension for the x:Key attribute below do and what kind of markup extension is it? <Window x:Class="App1.Window1" xmlns:dxg="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt; <DataTemplate x:Key="{dxg:Example ResourceKey=Example}"> <dxg:TextEdit Text="123/> </DataTemp...

WPF - Styles with Custom Properties

Hello. I'm developing a document number checking on my application and I wrote an attached behavior to textbox to check the text. Here's the behavior code: public class CPFTextBehavior : Behavior<TextBox> { static readonly DependencyPropertyKey IsCPFPropertyKey = DependencyProperty.RegisterAttachedReadOnly("IsCP...

Advice - How to view assembly code or debug into DLL or what's being loaded?

I am not sure how to pose this question, but basically I want more information on the following error and want to know what these assemblies contain. I am using VS 2008 and Silverlight 3 and basically I have 2 SL projects, with one referencing the other for a resource. I know the file is there, but don't know why I am getting the error...

WPF - Dependency Properties Error

Hello again. I'm working on a WPF project, and my intention is to make two specific RadioButtons alter properties of another specified Component. But for now, i'm just trying to store a String inside the RadioButton. For that, I've created a behavior class: public class AdjustBehavior : Behavior<RadioButton> { With this property...

WPF - What to do when a Dependency Property is another Control in the XAML

I'm hoping this will be my last question today. I'm in a hurry and google is not helping much (that or I'm searching the wrong places). I created some custom properties and behaviors so my RadioButtons can alter my labels Content and the mask of my TextBoxes. I could pass a String as a property, but how do I pass another control as a p...

WPF include resource directory XamlParserException

Hi, I have a userControl like this: <UserControl x:Class="LoginModule.LoginView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:controls="clr-namespace:UserControls;assembly=UserControls" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <UserControl.Resources> <ResourceDiction...

WPF DropShadowEffect on a transparent object

I want to be able to see a drop shadow, but not the object that is creating the drop shadow. The code below will only work if I give the ellipse a fill colour. <Ellipse Width="640" Height="640"> <Ellipse.Effect> <DropShadowEffect Color="Cyan" BlurRadius="60" /> </Ellipse.Effect> </Ellipse> This makes sence as an invi...

XAML scatterview

Hi, Normally I use the following construction to render a list of different items: <ItemsControl ItemsSource="{Binding DesktopVM.Content}" ItemTemplateSelector="{StaticResource EntityTemplateSelector}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas HorizontalAlignment="St...

Silverlight: Need AFTER Application.Current.Host.Content.FullScreenChanged EVENT

Problem: I'm using the Silverlight Application.Current.Host.Content.FullScreenChanged event to detect when a user switches back and forth between fullscreen mode. Unfortunately it seems that this event fires BEFORE anything on the screen is actually resized. I need to know the ActualWidth/ActualHeight of various FrameworkElements AFTE...

WPF Images not rendering from in-memory sources.

I have a data class in my application which maintains a collection of byte arrays representing JPEG images. It's defined as: private ArrayList FrameList = new ArrayList(); I'm having some troubles with my Image object rendering a blank page (and taking its sweet time to do it as well). When I insert a blank image with a 2K in-memory b...