WPF layout Control issue - wpf

I have wpf project which print label as per editor. Project has 17 different editors. This is small little drawing for my current application for current label editor.
It has several small controls like, Tool Box, Dimension Slider, Ruler, Canvas navigation bar, Label Definition bar etc... It has one more control called Label Editor, this control will vary as per different editors (17), other controls will stay as it is.
No I want to make some generic control which contains all controls except Label Editor, so each time when I create new editor I don't need to re-create all controls each time. I can use what I have for all 17.
What control should I take to do that, content control, control template, data template or user control for that. Here is small drawing what I have.
Pls share your suggestions.
Thanks
Dee

You could try loading the label editor through a Frame and create a page for each label editor.
Alternatively, you could create a custom control with a LabelEditor property that takes an object. This approach would be more difficult, though.

Related

create custom control which include a text and a image

I want to show a lot of (hundreds of or more) controls in a window, the control include a text and a image and have 4 different appearances (different text color and image), when user click the control, its appearance will switch among the 4.
In order to improve performance, I want to create a custom control and try to choose a good lightweight base class for it, after googling, seems UIElement is the most lightweight, which involving call DrawText and DrawImage on DrawingContext object, however, here indicate the DrawText is expensive.
Another choise is control such as ContentControl, TextBlock or Button, but they are more heavy than UIElement, does anybody have any advice? many thanks.

.NET WinForms Localization - How to make control position based on length of text

I am working on localizing a WinForms application through satellite assemblies. The problem I am facing is that when I switch to some other language such as Japanese from English, the labels overlap (or go behind) the combo boxes because of the change in text. The change in text causes Label width to increase making them jump over to other controls.
Is there a way (maybe through Anchoring) to overcome this so that the combo boxes decrease their width automatically to compensate for the Label size increase? Something like anchoring WRT a control instead of a Form.
UPDATE
OK. I think I've found a solution to this one. The Form has a Language property which is used to set language specific properties for a Form. If I change it to Japanese and make changes to Form layout and Control positions then these language specific items are stored in a new .RESX file for each Form. The Satellite assemblies will still be used to provide the localized strings but these RESX files will resize the Form elements accordingly. Is this the right way?
The Form has a Language property which is used to set language specific properties for a Form. If I change it to Japanese and make changes to Form layout and Control positions then these language specific items are stored in a new .RESX file for each Form. The Satellite assemblies will still be used to provide the localized strings but these RESX files will resize the Form elements accordingly.
I don't know anything that can resolve satisfactorily your problem.
There is the property AutoEllipsis=True (with AutoSize=False) that can alleviate the situation.
If set to True this property insert three dot to the right of the label when the text exceed the label dimensions. Positioning the mouse over the label will dispaly a tooltip with the full text.

how can i change controls when a button is pressed in xaml

i am trying to create a wpf app and have different parts in user controls.
in the navigation i have some buttons (now using the ribbon ctp). is it possible to change the main user control when different buttons are pressed in xaml. or is this just a bad way to do things?
sorry, really new to xaml and im trying to get my head arround it.
Further to what Carlo has said,
The way we do it is to have a blank grid in the place you want your controls to all appear and then use BlankGrid.Children.Clear() and BlankGrid.Children.Add() to set up which control is visible in this position.
We found that was the nicest programatically as we have a large number of custom controls, but Carlo's method would work nicely if you wanted to use the designer.
I think this is a pretty regular procedure in WPF. In my experience, me and other programmers put the controls where we want to show them and make their visibility hidden, collapsed or visible depending on what we want to show the user.

WPF page layout control selection

I have an imagebrush of a soccer field as the page background and I want to be able create a line up by dragging players off the bench and positioning them on the field accordingly. I don't know what control to use for the background that allows the PlayerCard control to reside where it is dragged. Any help as to how to begin would be appreciated.
You can get the idea here.
What control to use?
I believe you want the Canvas container control. It lets you arbitrarily place child controls with a Left and Top attached property, similar to the way Windows Forms does it.

I want to create a combobox in wpf

I want to create a combobox with some style. I dont want old dropdown what we are getting. I want some new dropdown which looks very nice. Is there any way to create a dropdown like that.
Plz give me suggestions
Check this link out on msdn. This is the actual control template for the combo box. You can copy and paste this into your application (within your app's Resources).
Create a form and slap a combo box on it with some data in it. Then start changing the control template and view the results. Start off simply by changing colors and adding borders around elements to see what controls which part. Then you can start switching out larger parts of the template to match what you're looking for.
one can start with the standard combobox, and then use various controls and styles to change the look and feel of the control, and it's corresponding drop down.

Resources