wpf-controls

WPF Control Template Trigger, how to reference sub object

I have AnswerContainer class which is inherited from ContentControl. The AnswerContainer has a public dependency property called Answer. public class AnswerContainer : ContentControl { public static DependencyProperty AnswerProperty; public Answer Answer { ... Answer property is of type Answer and has a public dependen...

wpf animation fade in freeze and fade out

Hi I want to show some data on a form. The form should fade in for 5 sec and display data with full opacity for 10 sec and then start fade out in 3 sec. I have do this programatically in c#. Please give suggestions or sample code. Thanks Raju ...

Stop highlighting selected item WPF ComboBox

Hi, I'm currently working on a WPF UI and I have a combobox on my window. So I want the user to be able to select an item from this combobox but when it is selected I don't want it to be highlighted in the default blue colour. I assume there is some way to stop this in XAML but I have not been able to find the solution so far. Thanks....

WPF: Implicit Infragistics Ribbon Styling using BasedOn

Hello, I'm using the WPF infragistics ribbon and I'm trying to work off their styles using the BasedOn attribute. This work well when the x:Key is defined however in the case where I want to override the property on a border located inside an implicit style, what's the best way to do that without duplicating the entire style into my cust...

How to change a ListBox's Vertical Scrollbar's Repeat Button Size in WPF

Hi there, I have a ListBox control with a vertical scrollbar. I would like to increase the Repeat Buttons' Height to something bigger because our UI is touch-compatible. Is there a simple way to do it ? Thank you and best regards, Romanin ...

Get element that stole focus before it does in WPF.

To be clearer. I need to know which element stole focus in the focused element LostFocus event. Something like this: I have 3 buttons: A, B and C "Button A" has focus "Button C" is clicked "Button A" LostFocus event is triggered In there I want to know that "Button C" stole the focus (Could've also been "Button B") Let me know if the...

Text content in a WPF button not being centred vertically

Is there a reason why the text content of a WPF button is appearing with unwanted space above the text? I have a button in a StackPanel. This button is a simple close button so I want it to appear as a square button with an "x" centred in it. I have set my padding to zero and set both the HorizontalContentAlign and VerticalContentAlig...

WPF ListView non integral scrolling

How do I turn off the integral scrolling in a WPF ListView? By default, scrolling a ListView jumps down so I must scroll a whole item at a time. I would like to scroll half way, quarter way, etc. ...

Using WPF expander control on microsoft surface platform

I am trying to use the Expander control in the surface application. I have seen its not a surface control so application compiles and control shows up but the contacts are not working. Is there anyway I can modify the contact events and make it work in surface applications. ...

In wpf how can i associate a window with the popup of a combobox

I want to create a WPF combobox which should have 2 listboxes alongwith ok and cancel buttons in its Part_Popup. How to go about it? Simply put showin a dialogbox on dropdown event with all other functionality intact. I tried to implement a custom combobox using FrameworkElementFactory but the result is too bad: 1) Its very difficult to...

wpf listbox dataBinding

i have a listbox who takes values from Dictionary Size: this is the Size type: public Dictionary<string, int> Size { get; private set; } this is my listbox <ListBox x:Name="boardSize" ItemsSource="{Binding Size}" ItemTemplate="{DynamicResource DataTemplate1}" /> this is my the associated DataTemplate: ...

Using wpf datagrid with ironpython and sqlite3

I am trying to figure out how to make use IronPython (2.6) wpf and sqlite3 (i use the Ironpython.SQLite.dll) I get somewhat stuck in how to use the wpf datagrid. Can anyone help me further in how to code in order to fill the datagrid with the data from the sqlite database thats made here. Below is the code on how far i got... 1st t...

wpf bind a controlitem to collection

hey there i am having problem i have List<List<memoryCard>> that i want to show in my xmal in a button how can I bind my button to the data i want thos is my usercontrol : < <ControlTemplate x:Key="ButtonControlTemplate1" TargetType="{x:Type Button}"> <Grid> <!--i think this is the place where i make mistake :--> ...

Cannot begin storyboard based on ListBoxItem selection???

It become really confusing since I started it. It supposed to be something simple but I already spent a good deal of time and cannot find a way around it. I need to run a storyboard on listboxitem selected with the node is 'name' and value is 'SERVERS'. The storyboard will change margins of the border with x:Name="ListBoxBorder". This bo...

wpf button trigger doesnt work as it should ...

i have a simple button whom i want to switch his template(or style ...)when he is being preesed i want to move from this <DataTemplate> <Button Click="Button_Click" DataContext="{Binding}" Height="65" Width="79...

WPF - DataTemplate question

Hi, I datatemplate a grid header with a button. When the button is clicked, I want to send the uid (which is a property of the grid column(parent)) as the command parameter. I Tried : 1. Template Binding 2. Relative Source 3. ElementName (doesnt accpet Binding) But nothing seems to work. Any clue, how to bind to a parent's property in...

WPF Combobox SelectedItem Problem

Hello, I am failing in achieving a very simple functionality from a WPF ComboBox. My ComboBox needs to list a collection of values. This works fine. The value id is also saved succesfully in the database. The problem is that when i want to open the window in edit mode, the combo stays empty. Here is the code : <ComboBox ...

wpf how to disable the defult animation when button is pressed

i have a memory card game where i want on clicking on a button to bind the prorty button background to this is what i am doing: <Button Name="btn" Click="Button_Click" DataContext="{Binding}" Height="65" Width="79" Background="Black"/> <DataTemplate.Triggers> <Trigger SourceName="btn" Property="IsMouseCaptured" Value="Tru...

WPF: How do I address a usercontrol that I Instantiated at runtime?

I have added a usercontrol to my project like this: Public Sub clickAutoDrillLeft(ByVal sender as Object, ByVal e as System.Windows.RoutedEventArgs) Dim LSliderItem as New TriplexAmpsControl me.LeftSlider.Items.Add(LSliderItem) End sub The "LSliderIn" object is an items control, and the "TriplexAmpsControl" is a userc...

WPF - Binding StringFormatting Not Working

Hi, I need to append a simple string to my commandparameter but doesnt work. Does StringFormat support this or am I doing anything wrong ? <DataTemplate x:Key="ClickableHeaderTemplate"> <Button x:Name="btn" Content="{Binding}" Background="Transparent" Command="{Binding DrilldownHeaderClicked}" ...