xaml

treeview selected item should highlight with some color

I have a treeview in wpf. I want a different color when i select the treeviewitem. Any Suggestions Plz.. Thanks ...

What is the difference between loading Pages or UserControls into a XAML Frame Element?

I'm rebuilding a WPF slide-show application structure that I found in the downloadable code for this WPF video. There is a Presentation class which has an INotifyPropertyChanged property "CurrentSlide" which changes as you click next/previous buttons and is displayed dynamically in a Frame element. The downloaded code loads Pages into...

I have 2 listboxes with images. i want to hide the image of first listbox when i use that image in second listbox

I have 2 listboxes with images. i want to hide the image of first listbox when i use that image in second listbox. and also i want to know the nooftimes that i added image to the second listbox. In the second listbox image should show count of that image(on the image itself) no of images that image added. Any suggestions.. Thanks in ad...

How can I define a variable in XAML?

I have the following two buttons in XAML: <Button Content="Previous" Margin="10,0,0,10"/> <Button Content="Next" Margin="0,0,10,10"/> How can I define "10" to be a variable so I can change it in one place, something like this: PSEUDO CODE: <variable x:key="theMargin"/> <Button Content="Previous" Margin="{Vari...

How to I stop Vista from pulsating my focused XAML buttons?

I've created a style for buttons in my WPF application. However, on Vista, when a button is focused, it pulsates with a light blue that doesn't look good in the design. How can I override this automatic pulsating? <Style x:Key="NavigationButtonStyle" TargetType="Button"> <Setter Property="Width" Value="400"/> <Setter Property=...

How do I preserve and format content in a wpf UserControl without breaking text wrapping?

I have this block of xaml that allows the text of a hyperlink to wrap around nicely: <TextBlock> <Hyperlink TextDecorations="None" Click="DoSomething"> <TextBlock TextWrapping="Wrap"> Click this text that is really rather long and overly descriptive in order to do something. </TextBlock> </Hyperlink> </TextBlock> It ends u...

I have a listbox with images. I want to select and deselect all the images in that listbox at once

I have a listbox with images. I want to select and deselect all the images in that listbox at once. I am using radiobuttons for that. one radio button is for selecting all the images in listbox and another radio button is for deselecting all the images in listbox. Can any plz help. Thanks in advance. ...

Silverlight Border object not visible when theme applied?

I have a applied one of the Silverlight Toolkit themes to my XAML page, and now for some reason my Border objects don't show up. Is this by design? I've made sure to explicitly state a BorderBrush color that should contrast the theme background, but this does not fix the issue. In case it helps, the theme I'm using is the BureauBlack t...

Binding to properties of a control in a tooltip

Hi, I want to display some properties of a (custom) Label in its Tooltip, but I can't seem to get it working correctly so must be doing something wrong: <Label.ToolTip> <Border BorderBrush="Gray" CornerRadius="5" Margin="5" Padding="5"> <Label Content="{Binding Path=Width, RelativeSource={RelativeSource Mode=FindAncestor, An...

How can a WPF UserControl inherit a WPF UserControl?

The following WPF UserControl called DataTypeWholeNumber which works. Now I want to make a UserControl called DataTypeDateTime and DataTypeEmail, etc. Many of the Dependency Properties will be shared by all these controls and therefore I want to put their common methods into a BaseDataType and have each of these UserControls inherit fr...

Silverlight developer wants to gain some designer chops - where do I start?

I'd like to reskin a Silverlight app to be more visually compelling. Unfortunately, I went to school for computer science, not design, and I have trouble deciding if two colors even match. How do I get started? Let me add that time and money are both factors so pursuing a design degree isn't an option (though it might be ideal). EDIT...

WPF: Customize a datatemplate using a binding property

Hi, I'm very new in WPF. I've got a ListBox where I want to set a template for an item (I called it Person). A TextBlock is to be used. The person has to public Properties: "Foreground" and "IsOnline". If "IsOnline" is true, I would use the "Foreground" property of the person, otherwise "Gray". That's all. My first template is: <DataTe...

xaml Application Resource Value

I want to set an application wide Value i.e. TextHeight (others as well) and I can't seem to find a reference. IOW, set the Text Height to a StaticResource in various styles, etc. TIA ...

Running a Silverlight Website

When using silverlight in a browser is there anyway to switch xaml pages? I'm also wondering how to go about using my encryption class I've wrote in c# to validate users in silverlight. Any help would be much appreciate! ...

Forcing a WPF tooltip to stay on the screen

Hi, I have a tooltip for a Label and I want it to stay open until the user moves the mouse to a different control. I have tried the following properties on the tooltip: StaysOpen="True" and TooltipService.ShowDuration = "60000" But in both cases the tooltip is only displayed for exactly 5 seconds. Why are these values being ignore...

I want to create a wpf application which will remove the red eye from the image

I want to develop a WPF application. Now what i want is with that wpf application can i able to remove the red eye in the image or i have to use any other third party tool for that. any suggestions plz. Thanks in advance. ...

Getting a flowdocument from a xaml template file

I got a Xaml file that starts like this: <FlowDocument x:Name="flowDocument" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Drawing="clr-namespace:System.Drawing;assembly=System.Drawing" Current solution uses a StremReader by ...

WPF MenuItem Header and HeaderTemplate

I want to bind a list of KeyValuePair to a list of MenuItems. I thought I should use MenuIten.HeaderTemplate, but it didn't work. I only got blank headers. <MenuItem Header="Template" ItemsSource="{Binding Path=Samples}"> <MenuItem.ItemTemplate> <DataTempl...

How to inject a Converter in XAML

I have an IValueConverter implemented class and I need it to be injected using my DI container (Ninject). The problem is, in XAML, there's no immediately obvious way to get control over the instantiation of the Converter object. So my XAML contains a line something like this: Source="{Binding Path=CurrentMessage, Converter={StaticR...

what is the best way to emulate XAML code inheritance?

I have a number of UserControl classes: DataTypeWholeNumber DataTypeLine DataTypeDate DateTypeDuration etc. They all inherit from a plain C# class which inherits from UserControl which has no XAML attached to it. I had to do it this way since I was getting errors saying that XAML could not be inherited. The problem is that the XAML ...