GridViewVirtualizingPanel panel = GridViewItemsControl.GetVirtualizingPanel(RadGridView1.ItemsControl); |
panel.ScrollOwner.VerticalScrollEnded += new EventHandler<System.Windows.Controls.Primitives.ScrollEventArgs>(ScrollOwner_VerticalScrollEnded); |
How do you color a rectangle in C# that has been declared in XAML in WPF?
There is a rectangle control in XAML. In my C# code there are times in which it would be nice to fill the background color. How does one do this?
The rectangle has a text block nested inside. The Fill works to color the whole rectangle but it also blocks out the text. On the other hand, using the stroke first colors the rectangle and I can modify the enclosed test but the rectangle does not have a boarder.
The way to do it might be to bind the Rectangle background colouur to a property and use INotifyPropertyChanged to trigger the update of the colour based on the change.
How do I bind the Rectangle background colour to a property?
"You can´t add a refernece to Telerik.Window.Controls.DataVisualistion.dll as it was not built against Silverlight runtime. Silverlight projects will only work with Silverlight assemblies"
The thing is that I have very limited rights on my computer, for every install or un-install or whatever, I have to get our IT-guys involved, and that can mean I have to wait for hours or days.
We have noticed with your chart control that when we set it so that the point labels are showing it makes the opacity of the series definition read only. Is there a way to disable this behavior or work around it so that we can change the opacity in this case? Currently we turn the opacity to 50% for all other series when the user hover’s the mouse over one of the series items in the legend. If the point labels are on and the opacity locked we are unable to do this. Any help on this matter would be greatly appreciated.
Thanks in advance
MacKenzie
We have noticed with your chart control that when we set it so that the point labels are showing it makes the opacity of the series definition read only. Is there a way to disable this behavior or work around it so that we can change the opacity in this case? Currently we turn the opacity to 50% for all other series when the user hover’s the mouse over one of the series items in the legend. If the point labels are on and the opacity locked we are unable to do this. Any help on this matter would be greatly appreciated.
Thanks in advance
MacKenzie
<Window x:Class="radcarouseltest.MainWindow" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
Title="MainWindow" Height="350" Width="525" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> |
<StackPanel> |
<telerik:RadCarousel Name="carousel" FlowDirection="LeftToRight" VerticalAlignment="Center" |
HorizontalAlignment="Center" HorizontalScrollBarVisibility="Disabled" /> |
<Button Content="LoadImages" Click="Button_Click" /> |
</StackPanel> |
</Window> |
using System; |
using System.Collections.Generic; |
using System.Windows; |
using System.Windows.Controls; |
using System.Windows.Media.Imaging; |
using Microsoft.Win32; |
namespace radcarouseltest |
{ |
/// <summary> |
/// Interaction logic for MainWindow.xaml |
/// </summary> |
public partial class MainWindow : Window |
{ |
private const String ExtensionFilter = "(*.jpg)|*.jpg|(*.gif)|*.gif|(*.png)|*.png|(*.tif)|*.tif|(*.tiff)|*.tiff"; |
private List<BitmapImage> imageList; |
public MainWindow() |
{ |
InitializeComponent(); |
imageList = new List<BitmapImage>(); |
} |
private void Button_Click(object sender, RoutedEventArgs e) |
{ |
OpenFileDialog dialog = new OpenFileDialog { RestoreDirectory = true, Filter = ExtensionFilter, Multiselect = true }; |
if (dialog.ShowDialog() == true) |
{ |
foreach (string fileName in dialog.FileNames) |
{ |
BitmapImage myImage = new BitmapImage(new Uri(fileName, UriKind.Relative)); |
imageList.Add(myImage); |
updateCarousel(); |
carousel.SelectedItem = carousel.Items[imageList.Count -1 ]; |
} |
} |
} |
private void updateCarousel() |
{ |
carousel.Items.Clear(); |
foreach (BitmapImage img in imageList) |
{ |
Image myImage = new Image(); |
myImage.Source = img; |
carousel.Items.Add(myImage); |
} |
} |
} |
} |