wpf

WPF Animate Multiple Buttons

I have a control with 5 buttons, and I would like to make all of them shift diagonally when any of them are clicked. What would be the best way to do this? If it were a single button, I could use a Storyboard and DoubleAnimate, but I believe that if I apply this to multiply buttons, they would shift one by one, instead of at the same ti...

What do we use glyph for?

What is a glyph and what do we use it for especially in context of silverlight and xaml? ...

DirectX Primitives equivalent in WPF ?

There are Primitives types enum in DirectX that contains Point, Line, LineList, LineStrip, Triangle, TriangleFan, TriangleStrip... I can find only Triangle in WPF 3D. Then how to draw point, line , or wired object. If I do not supply material then I cannot see anything Thanks ...

How do I implement high performance 3D graphics w/ WPF?

Hi, I have to develop a CAD application and I am planing to use WPF with C#. Earlier I had used GDI+ with C# to write similar application. How can I perform the graphics operation in WPF similar to GDI+? I want to set the pixel color with pencil (similar to MS Paint), draw some basic shapes such as circles, lines, rectangles etc etc. ...

How do I access the ItemPanel programmatically?

How do I access the listviews panel in code behind? Xaml definition: <ListView.ItemsPanel> <ItemsPanelTemplate> <telerik:RadCarouselPanel /> </ItemsPanelTemplate> </ListView.ItemsPanel> If I name the panel, I get a compile-time error when refering to it in the code-behind. ...

Using converters for DataGrid Column

I create my windows databainding infrastructure with MVVM pattern. I have method which return data for my DataGrid. Problem that I want some columns in DataGrid use Converter (IValueConverter) but I bind my DataGrid to the data directly. I can't strongly type columns specification in xaml because number of columns can be different. Also...

WPF: How to set offset to PolyLine

I have 3 PolyLines that have same geometry. I would like to set offset to two of them, so they would appear right next to each other. How can i do that? thanx. ...

Changing a property of something in XAML from a button click

Given the following bit of XAML <Border Name="Brder" Visibility="Visible" Width="10" Height="10" Background="Red"></Border> <Button Content="Hide"></Button> How can I set the button click to change the visibility of the border (not using code behind)? I know it's trivial in code behind and the routed click event only seems to allow s...

WPF Prism Inject same viewmodel instance into two views

So I have two separate views in a WPF Prism app. How can I inject the same instance of a viewmodel into both the views via Depencency Injection? ...

BackgroundColor of a disabled TextBox

I have a TextBox that is defined through a ControlTemplate. Because of the ControlTemplate, the TextBox is no more automatically grayed out when the IsEnabled-property is set to false. To provide this functionality, I use the following trigger within the ControlTemplate: <Trigger Property="IsEnabled" Value="False"> ...

How to change the access modifier of a user control

I have a user control created in xaml, lets name it "View". In the View.xaml.cs I changed the access modifier for the class View to internal: internal partial class View : ViewBase { ... } After changing the access modifier the compiler states the error: Partial declarations of 'A.B.View' have conflicting accessibility modifier...

How to disable animation in WPF button

Hello, I have this WPF 4 code: <Button Content="{Binding Path=Header}" Command="{Binding Path=Command}" CommandParameter="{Binding Path=CommandParameter}" Focusable="False"> <Button.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="White" Offset="0"/> <Gradient...

Calculate the visible area of the image in WPF

Hi, I have implemented a custom canvas in WPF with c#. The canvas will be keeping custom drawing shapes. I have also added a zooming functionality to it. When the canvas is zoomed at very high level, I want to calculate the visible part of the canvas so that I can perform operation on that much portion of the canvas keeping the best per...

How I Can Store Error when I am offline.

Hello EveryOne, I am using standalon application and I am using error reporting. Once I am online there is no problem, but when I am in offline so how I can make provision to store the error for the offline user. And Once user will comes online how I will send this error messages.. I am using WPF Standalon Application. Thanks... ...

Problem with ListBoxItem - produce "System.Windows.Data Error: 4"

Hi. I have craeted the fallowing ListBox: <ListBox x:Name="RecentItemsListBox" Grid.Row="1" BorderThickness="0" Margin="2,0,0,0" SelectionChanged="RecentItemsListBox_SelectionChanged"> <ListBox.Resources> <Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}"> <Style.Trig...

How to reuse control template?

Can I create parametrized control template, i.e. create control template which might contain different controls. For instance, I can use control template with label or with button - whatever I want in some position. <ControlTemplate x:Key="MessageCTemplate"> <Grid …> <Rectangle …/> <Rectangle …/> <Rectangle …/> … <!--I want to...

Use PropertyValueEditors At Runtime

I am trying to build a WPF control that allows users to edit the values of non-specific types outside of the context of a runtime PropertyGrid. The WinForms PropertyGrid makes use of UITypeEditors and these can be obtained and utilised at runtime via the relevant TypeDescriptor method. The Visual Studio PropertyGrid, on the other hand,...

Best Practise to get data for DataGrid from Web Service.

I have WPF DataGrid which get his data from Web Service. End user has ability to customize visible columns in DataGrid. 1st approach: I get this data in xml and after convert xml to the dataTable and give it like ItemsSource for DataGrid. 2nd approach: Also I can get this data like class array from service (for example Customer[]) ...

How to make a background animation in WPF with forks to other animations when necessary?

I have a WPF application that I need to spruce up a bit with background animations similar to the background ‘flair’ that you see playing on a Tivo device (lights moving, balls rolling, etc…) or a DVD menu (where you can go in any direction from the menu). Depending upon the state of the application, I would want the background animatio...

Reusing of DataTemplate

I have two DataTemplates for different cells in my Treelistview control. the templates are 90% similar. How can I reuse the identical Xaml ? <DataTemplate x:Key="@names"> <TextBlock Name="txt" Text="{Binding Names}" Style="{DynamicResource @BasicTextBlockStyle}" Foreground="{Binding RelativeSource={Rela...