UserControl cropped when used in MainWindow

Hello Stackoverflowers ! I'm creating a list with a searchbar in XAML, and when i tried to use my new UserControl in MainWindow.xaml, the Button in the UserControl is cropped in the designer instead of being resized to fit, why is that ? Here is th...
more »

2017-01-13 23:01 (2) Answers

SQL Command with string as Tablename

private DataTable zGetTableContent(string tablename) { DataTable dt = new DataTable(); Connection.Open(); MessageBox.Show(tablename); Adapter = new OleDbDataAdapter("SELECT * FROM '%" + tablename + "%'", Connection);...
more »

2017-01-13 08:01 (2) Answers

WPF tooltip arrow placement

I need a little guidance. I am trying to create your own ToolTip with an arrow. I ran into a problem. If the ToolTip too close to the edge of the screen, so of course change the tooltip positions, but no longer for themselves arrow. I tried to solve...
more »

2017-01-13 00:01 (0) Answers

Drawing a circle with GDI graphics on WPF

I need to draw with GDI graphics a circle on my form in WPF. I can't do this with windows forms, so i have added a using. I can not use the Elipse controls from WPF. My teacher told me to do this like this. This is my code: public void MakeLogo() {...
more »

2017-01-12 20:01 (1) Answers

One Storyboard for multiple triggers

Context: I have two Storyboards in my UserControl. One of them is for sliding the UserControl in and one is for sliding it out. All I'm doing for the slide in/out is setting the margin to a negative value for sliding out and to zero for sliding in....
more »

2017-01-12 16:01 (1) Answers

MEF how to get non-shared instance references

Recently, I encountered a problem when I use MEF in my WPF application. I created several classes like below. Part type was set to be CreationPolicy.NonShared so that there will be 2 different object imported to ClassA and ClassB. [Export] [PartCrea...
more »

2017-01-12 06:01 (1) Answers

How to create 3D plane from lines

I'm using Helix Toolkit with WPF, and I want to take a bunch of lines and turn them into a surface. To clarify, I have a group of 3-dimensional curves, and I want to get the curved blade that would result from all of these lines. (The lines represe...
more »

2017-01-11 18:01 (1) Answers

WPF Context Menu pops up after Binding changes

I have a Border control inside a UserControl which is used as a switch for graphical changes. The Border has a context menu with two MenuItems: "Open" and "Close". When the switch is closed only the "Open" MenuItem is visible, and when the switch i...
more »

2017-01-11 15:01 (2) Answers

How to create a 3D tube with a varying diameter

I'm using Helix toolkit with WPF, and I'm trying to make a 3D image that includes a pipe/tube that has a varying diameter. Essentially, I'm trying to take a non-straight line and rotate it around an axis, creating a tube. I only care about the resu...
more »

2017-01-10 15:01 (1) Answers

Action on ComboBox selection changed

I'm using MVVM to bind a ComboBox to a ViewModel, and I have few question about heavy actions and selection change. I want to trigger some actions when the selected item is changed, my initial approach was to put the logic in the setter of the field...
more »

2017-01-10 15:01 (2) Answers

wpf c# backgroundworker wait until finished

I have several textboxes in my wpf application. The LostFocus-Event of each textbox starts a backgroundworker to send the data to a connected serial port. private readonly BackgroundWorker online_mode_send_worker = new BackgroundWorker(); online_mod...
more »

2017-01-10 14:01 (6) Answers

WPF Element Rendering Order

Background I needed a charting system for an app that I am working on and was unable to find anything free that was able to do what I required, so I decided to write my own. The solution so far I'll avoid going into to much detail of the design at...
more »

2017-01-10 04:01 (0) Answers

Caliburn Micro run code on label click

I'm using WPF alongside Caliburn.Micro. I want any code to be run when a label is clicked. I tried some googling and found out about cal:Message.Attach. XAML: <Label x:Name="Info" Content="Info" HorizontalAlignment="Left" Margin="305,440,0,0" V...
more »

2017-01-10 02:01 (1) Answers

Returning two values from combobox

In my program I have stored values in list. I need to return two of these values from one combo box. I have searched in internet but couldn't find the answer. Please give me some tips. Here is my code: Values in List: public class ActualCurrencyBox...
more »

2017-01-08 23:01 (1) Answers

Use Toast Notification in WPF MVVM

I created a custom control 'Toast Notification' in WPF and i want to use it in MVVM to display messages, but i don't know where implement it (MainWindow or each page) and how send messages from each page to toast notification. Please help me to fix t...
more »

2017-01-08 20:01 (1) Answers

Bind ItemsControl with WrapPanel wpf

I've searched a lot before posting this question but I didn't find any reasonable solution. I'm trying to create grid containing the textboxes using ItemsControl. Here is my xml: <ScrollViewer> <ItemsControl x:Name="grid"> ...
more »

2017-01-08 16:01 (1) Answers