xaml

ScrollViewer and TextBlock doesn't have vertical scrollbar

I am playing with XamlPadX and here is the code I have so far: <ScrollViewer Name="Scroller" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Height="100"> <TextBlock Name="txtLog" TextWrapping="Wrap" VerticalAlignment="Stretch" Height="100"> ...

silverlight grid background image

Hi, How do you set the backgound image of a grid in c# (code behind). Thanks Sp Can I do something like this? public ImageSource ImageSourcePin { set { this.DreamTypeImagePin.Background = value; } } This worked,thanks for your help public String ImageSourcePin { set { ImageBrush img = new Ima...

XAML tostring in ContentControl

I am new to the XAML world and I'm fumbling my way through a lot of tutorials. One thing i'm stuck on is calling the .tostring on an object. Here is mysetup I have a listbox that is bound to a list of objects I have a contentControl bound to the same list that displays the selected item from the listbox. My ContentControl is as follow...

Changed Background Color of Element when Disabled

How would I change the background color of a TextBox Control in the Default Style Xaml to be a different color when the control is either Disabled or ReadOnly ? ...

wpf xaml calling a method on the current object

Im attempting to bind to the output of a method. Now I've seen examples of this using ObjectDataProvider However the problem with this is ObjectDataProvider creates a new instance of the object to call the method. Where I need the method called on the current object instance. I'm currently trying to get a converter to work. Setup: ...

wpf - why does this XAML override template not work

Any ideas regarding why the WPF XAML code I have is not working. I'm trying to override the WPFToolkit charting display, and have taken their default XAML and included in my Grid.Resources section as a means of overriding. Specifically I'm wanting to remove the graph markers, but this specific question pertains to clarifying my underst...

Is there a way to make XAML / C# StringFormat show whole dollars for larger amounts but cents for smaller amounts?

In XAML, it is easy enough to use StringFormat='$#,0;$-#,0;Nil' to make a bound integer variable display as a nicely formatted dollar amount. e.g., 1024 would come out as '$1,024'. I have a need to deal with numbers ranging from a few cents up to a few hundred dollars - so 0.45 should display as '$0.45', but anything greater than some t...

Silverlight horizontal carousel for thumbnails?

UPDATE: I have found this solution... modified it, but am struggling to get it to do a continuous cycle (1st item pops to last in list/array) Any help is much appreciated! using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Docum...

ItemsControl, ItemsPanel and ItemsPresenter (Silverlight, XAML)

I'm utterly confused by these 3 terms, when to use which? What's the relationship and they are children of which controls? Is it correct to say this is the tree: ItemsControl > ItemsPresenter > ItemsPanel ...

Command Parameter is null in a Command of CustomDataGrid.

This code works fine : <sdk:DataGrid ItemsSource="{Binding MyItems}" SelectedItem="{Binding MySelectedItem,Mode=TwoWay}" x:Name="dataGrid"> <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged"> <i:InvokeCommandAction Command="{Binding CommandName}" CommandParameter="{Binding ElementNa...

Is there an easy way to make anything draggable in Silverlight XAML?

My target is an entire listbox clipped in a canvas, but I guess there should be something that can work for all controls? How to make a control draggable and even attached x or y constraints? ...

VB.NET - For Each in WPF-Controls

Hey people, I want to check some childelements in my WPF-Form. In WindowsForms that was quite easy with (like): For Each control as Textbox in Me control.text = "hello people" Next How do I do that in WPF within my XAML.VB-File? I got a listbox with some childelements here which I want to analyse. Greetz and thanks for your ideas! ...

Expression blend Xaml toVisual Studio

Hi All, We have a weird blend bug. On vista we created some blend anims and everything built properly. We have since upgraded to Windows 7 and now when we build anims in blend the anims play in the animation preview window but NOT when the anim is built. If we copy the XAML to Visual studio the images copy across ok but all animation ...

How to display search results in a WPF items control with highlighted query terms

I'd like to display search results within a WPF ItemsControl with the query terms highlighted. The search engine I use, Lucene.Net with the Highlighter plugin, returns strings with the query terms marked up like so: ...these <Bold>results</Bold> were found to be statistically significant... I can instruct the Highlighter plugin to us...

How to manually reload the Visual Studio designer for WPF

Is there any way to force the WPF designer to reload or refresh, without rebuilding the entire project or solution? If there's an error, I get an option in the designer view to refresh the designer. But if I don't have an error, how can I get the designer to refresh after I've made a change? ...

Blend/VS designer support for adding complex content based on boolean property

I have my own derived WPF DataVisualization chart control and within that control, I have a boolean property that the designer can set which in turn creates and adds a line series to that chart control. Now the problem is that I can easily create the line series object within the chart when the designer sets that property, but I also ne...

Dynamic Clipping Width in Silverlight Within Canvas

Why does this throw an error and how can I fix... I need to set the clipping rect to be dynamic. <Grid.ColumnDefinitions> <ColumnDefinition Width="42"/> <ColumnDefinition x:Name="ListBoxContainer" Width="*"/> <ColumnDefinition Width="42"/> </Grid.ColumnDefinitions> <Canvas> <Button x:Name="b...

How to use Dictionary to provide data (which are defined in runtime) to DataGrid (xaml) in SL4

Hi, I am looking for information on how to provide data to DataGrid using Dictionary. My use case is: I have WebService that provides me a table with the content (and column names) I get know in runtime. My current implementation of a data tuple is: public class GridTuple : Dictionary<string, string> { public GridTuple(IDic...

Listbox carousel - is it possible?

I'm not using a listbox and data binding at the moment, but is it possible to have a listbox work like a carousel and if so, how. This is what I'm using at the moment, which only works for adding images, not through binding in a listbox... can it still be modified to position each binded canvas+image in the suggested answer? // add ima...

How to set current CultureUI via XAML binding

I have a TextBlock bound to a string. I want the string to be displayed in current UI culture of the application. I want to do this in XAML. The text block is simple like below. <TextBlock Text="{Binding Path=Text}"/> ...