|
Hi,
I think i was a little too generic in explaining my problem. I will give my current scenario.
I am trying to build an MDI in WPF. As you know there is no concept of MDI in WPF but i got a simulated MDI code from codeplex. The link for the same is given here. Now i want to tile the child controls in the mdi either horizontally, vertically or cascade in the way similar to windows MDI like this.LayoutMdi(MdiLayout.TileHorizontal); .
Please help!
Thanks in advance.
Regards,
Samar
|
|
|
|
|
Did you mean something like this?
[code]
<Canvas>
<Rectangle Width="50" Height="50" Fill="Red"
Canvas.Left="50" Canvas.Top="50">
</Rectangle>
</Canvas>[/code]
Try to copy and paste this in a blanc scene, it that what you want then you can also do this in code behind
[code]Rectangle rect = new Rectangle {
Width = 50,
Height = 50,
Fill = new SolidColorBrush(Colors.Blue) };
Canvas.SetLeft(rect, 50);
Canvas.SetTop(rect,50); [/code]
|
|
|
|
|
Yeah something on the similar lines. I got the solution as.
uc1.SetValue(Canvas.TopProperty, Convert.ToDouble(12));
uc1.SetValue(Canvas.LeftProperty, Convert.ToDouble(12));
The above will move the usercontrol uc1 12 from the top and 12 from the left. Thanks.
Regards,
Samar
|
|
|
|
|
Hi, I've been playing around with the code found at this website: http://dvuyka.spaces.live.com/blog/cns!305B02907E9BE19A!171.entry
It uses thumbs for dragging and LineGeometries for drawing connections between them. I was wondering if and how one would go about removing these at runtime, such as by right-clicking on them.
Thanks!
|
|
|
|
|
Find the link item that you want in the child collection and remove it.
connectors.Children.Remove(link);
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Well i figured out that part, but my question is more of how to find the link item in the child connection from a mouse click. Is that possible?
|
|
|
|
|
Without going through the code in depth, I'd imagine that the Link object would have an IsSelected property available on it - it should be a simple enough. If it doesn't, you'll need to perform a hit test (typically in the OnMouseLeftButtonDown event handler:
Point pt = e.GetPosition((UIElement)sender);
HitTestResult result = VisualTreeHelper.HitTest(canvas, pt);
if (result != null)
{
LineGeometry line = result.VisualHit as LineGeometry;
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
i keep getting result as null when i click on the LineGeometry/Path
|
|
|
|
|
Hi all,
i have a issue in focusing the datagrid in WPF.
Its a data entry form in which,
the datagrid will be filled w.r. to a text box.
that is i am having one text box, upon entering some values in the text box and after clicking the tab(lost focus) the data grid will get filled.
i have given the tab index as
Text box -1
datagrid - 2
button - 3.
But now when i press tab from the text box the tab focus is going to button and not the datagrid.
the focus is coming to the datagrid after completion tab's of all tab enabled control in my form.
Any idea to fix this issue?
thanks in advacne
|
|
|
|
|
I am new to silver light ..i am using IIS 5.1 and silver light 3.0 . How to deploy ...please help!
|
|
|
|
|
There are quite a few articles on this topic available on the internet.
See here for starters.
|
|
|
|
|
You're going to have to implement it yourself and then come back here if you have problems. The topic is WAY too broad to provide a "one-size-fits-all" answer.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
i have done all the Rnds. but still getting following error
"Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid".. Please help!
|
|
|
|
|
Hi Experts,
Unlike in windows forms, wpf's toolbar does not have an "ItemClicked" event associated with it where i can have just 1 event for the clicks of all the items (buttons) present in the toolbar. I can very well create an event for each and every button but i want to reduce the mess that the individual event would create in code. Is there a work around to achieve this functionality?
Thanks in advance.
Regards,
Samar
|
|
|
|
|
Hi all,
I have a quantity attribute in a dataform and want to validate it.I also have two methods for validate it. Their name are : ValidateUnit and ValidateQuantity.
But unfortunally i could only call one method for validate it by following below code :
[CustomValidation(typeof(UnitValidation), "ValidateUnit")]
public string Unit;
.......
How could i call two methods for validating Unit ?
|
|
|
|
|
I m working using silverlight web application. I have 3 group box and those are arranged one by one. Each groupbox have the set of textboxes with an tabindex incremented by one. the problem is if I press the tab key when I am in the focus of last control of first groupbox and focus is disappeared. Actually it supposed to focus to the first input control of second groupbox. but only press again the tab key, it focuses to the first input control of second groupbox. so this process should be same as second to third groupbox.
can anyone please solve this?
advance thanks for your help.
G Nathan
|
|
|
|
|
Hi,
I want to use MVVM approach to achieve something like below:
I have a MainWindow where i have a 3 Buttons like: a)Customers b) Orders c) Sales
By clicking on button, it should open its respective window/usercontrol xaml with customers details,orders details,sales details.
I have tried everything but culdnt able to do so.
How to achieve this using MVVM pattern. Kindly provide the solution?
Thanks
|
|
|
|
|
tarun23 wrote: Kindly provide the solution?
That honestly would be hard as a lot of code will need to be written.
What you can do is create 3 view / view models for customers, orders and sales and launch them separately on each of the three button clicks. You should also take a look at some of the view/view model samples available on the internet.
You might want to post what you have tried so far so that others can go through it and tell you what might be missing.
|
|
|
|
|
Thanks for the reply. I am not getting where to bind the customer button that I placed in the MainWindow.xaml in xaml or some cs file. I have this hierarchy: in View folder -- Customer.xaml file
in ViewModel folder -- CustomerViewModel.cs
in root -- MainWindow.xaml. In this, I have the Customer Button
I am using RelayCommand.cs to fire the button click event
In CustomerViewModel.cs file, I have put
public class CustomerViewModel
{
public RelayCommand CustomerCommand
{
get { return new RelayCommand(param => { return true; }, param => { OpenCustomer(); }); }
}
private void OpenCustomer()
{
//some code }
}
Kindly Suggest,
Thanks.
|
|
|
|
|
tarun23 wrote: . I am not getting where to bind the customer button that I placed in the MainWindow.xaml in xaml or some cs file.
You will bind the button to a commmand that will be placed in the datacontext of your MainWindow.xaml.
(probably MainWindowViewModel.cs or CustomerViewModel.cs).
|
|
|
|
|
How to declare the datacontext of my view in viewmodel in my case. Kindly suggest.
Thanks
|
|
|
|
|
You don't set the datacontext of a view in the viewmodel. What you do, and there are many versions to this, is declare the VM as the DataContext of the view. How you do it depends on how comfortable with the different mechanisms of binding available, e.g. you could set it in the View XAML, or in the code behind. Supposing you set it in the code behind, you set it using something like this:
private MainWindowViewModel _mmvm;
private void SetupViewModel()
{
_mmvm = new MainWindowViewModel();
DataContext = _mvvm;
} Then all you need do is call this method, and you have hooked it up.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks for the reply. I am new to this MVVM design pattern so i am not getting exactly where to put what. and how to call the commands and all. Also where to set datacontext of what window. Kindly suggest? Thanks
|
|
|
|
|
You would call this method immediately after the call to InitializeComponent(); in the code behind. In order to bind to a command, you simply need to use Binding as in Command="{Binding MyCommand}" where MyCommand is the name of a command that implements ICommand in the VM (note that RelayCommand implements ICommand).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I'm writing a SL3 app that uses the Silverlight Data Visualization Toolkit. A new version of the toolkit was released in April that added stacked series, but only added it for the SL4 version of the toolkit. I've tried a couple of different ways to reengineer the stacked series to workmin SL3:
0) Copy the entire set of Data Visualization folders from the SL4 version to the SL3 version. This resulted in a compiler error involving SL4 (the Fallback property in a class I don't remember - maybe IEnumerable, but I'm not sure). I abandoned this one when I started getting SL4-specific errors
1) Copy JUST the files I need from the SL4 version to the SL3 version. This actually compiled clean, but it throws a null reference exception that I'm finding it difficult to track down. I think I want to try to stick with this approach, because it looks like I'm closer to success with it.
I can transfer all of the files to whoever would like to look at it if we can figure out a transfer mechanism (maybe creating an unfinished article and provided the code as the article download.)
EDIT ======================
Here's a more complete descrioption of the problem:
http://forums.silverlight.net/forums/p/187997/431306.aspx#431306[^]
I've got to have this fingered out by noon today (3.5 hours from now), or work on it after hours and on weekends.
.45 ACP - because shooting twice is just silly----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
modified on Tuesday, June 22, 2010 9:29 AM
|
|
|
|