|
Seriously? WPF seems way cleaner then MFC or Winforms. Sounds like you need a better MVVM framework .
|
|
|
|
|
|
The best framework is one you write yourself
No joke. This is exactly what I did. There are a lot of popular frameworks out there: MVVM Light, Cinch, etc, but I've never been a fan of grabbing a bunch of open source libraries and getting them to work together. By writing it yourself, you learn MVVM and you know how stuff works inside. Imagine if you used Cinch and found some issue? Sascha is very active on CodeProject, but you never know what could happen down the road. Personally I like real light-weight stuff. So I pretty much have a full light-weight MVVM framework + light-weight DI container and don't have any of the Silverlight fluff that other libraries have.
|
|
|
|
|
I am not a fan of just grabbing a framework
either. At least you have to know the concept of what is happening in there. Otherwise when you will run into bug of the framework you will get stuck.
I am now in the process of making this decision. I know MVVM is the way to go. But I think I will start with my own implementation to see before I get involved in a framework.
Do you know this framework?
<a href="http://www.codeproject.com/KB/WPF/CatelPart0WhyChoose.aspx">Catel - Part 0 of n: Why choose Catel?</a>[<a href="http://www.codeproject.com/KB/WPF/CatelPart0WhyChoose.aspx" target="_blank" title="New Window">^</a>]
It’s a relative newcomer. What do you think of it?
|
|
|
|
|
I am developing an application for a project, and it requires many different features that each has to be addressed in a separate window....
so it should be built on something like a (next//back) hierarchy. This is what I've been doing:
**************************************
Parent par;
public Subclass(Parent var)
{
par = var;
par.hide()
this.show()
}
public void getback()
{
Parent.show()
this.close()
}
**************************************
the problem is, windows pop-up in different locations, and its generally unattractive... is there a better way to handle things in one window, or perhaps spawn windows at a specific location?
thank you
|
|
|
|
|
I siggest you read up on navigation[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I usually have everything in user controls, not in their own forms, so navigation from one to the next simply iterates through a collection of user controls - making one visible and showing the other.
depending on the complexity of the project, and the likelihood of re-use, you could easily develop a simple framework to support this
A quick search for Wizards could be in order too - as this is the paradigm you're talking about, I think
|
|
|
|
|
I hate wizrd based UIs, even with a small process you spend so much time catering for edge cases it is a painful.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have a style on my datagrid to disable a DataGridRow based on a property binding. This makes the row unselectable, which is what I want. However, I am still able to select the disabled rows using at least 2 other ways. The first is if I use a dragging motion between two enabled rows that surround the disabled row. The second is if I click on the "select all" button on the top left of the datagrid. Is there a way to make specific rows completely unselectable?
This is what I currently have:
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<DataTrigger Binding="{Binding DisableMe}" Value="True">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
|
|
|
|
|
You can try setting the IsHitTestVisibleProperty to false
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<DataTrigger Binding="{Binding DisableMe}" Value="True">
<Setter Property="IsEnabled" Value="False" />
<Setter Property="IsHitTestVisible" Value="False">
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
But the problem is that the Hyperlink will also not work with this.
you can check the reference here[^]
The Second solution will be to use your style same way
But just change the Trigger of IsSelected to Multitrigger & Check for the IsEnabled for true like this
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True"/>
<Condition Property="IsEnabled" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Opacity" TargetName="BackgroundRectangle" Value="0.5"/>
</MultiTrigger>
this way the problem you stated that you can select it using SelectAll will be solved & Hyperlinks will also work.
But in both these solutions when you check the SelectedItems Collection it will contain that row as well with other rows.
Changing circumstances require changing attitudes.
"Challenges are what make life interesting ;
overcoming them is what makes life meaningful." Mark Twain
"Insanity is doing the same thing over and over again but expecting different results.” — Rita Mae Brown
|
|
|
|
|
Hello,
I have a base class "A", and five other classes which inherit from "A".
"A" have public properties so does the other five classes.
What i want to create is a GUI thru which the user will be able to modify the properties of the five classes.
The straightforward way is to create five GUI's for each one of the classes, in the GUI will be an edit box for each property and some acknowledge button.
But this seems to me like a hard unnecessary work.
So what i want to do is:
To create some how a class which will receive one of my five classes and he will create the GUI for him on the fly according to the number pubic properties that the class have.
I hope i explained my self clearly enough.
Thanks.
|
|
|
|
|
thats what a property grid does.
|
|
|
|
|
Hi,
I am not sure how to get two dates from one calender.
I looked at Calender SelectionMode="MultipleRange" but I can't get two selected dates when I bind SelectedDate to the property in the viewModel. I looked at SelectedDateS but it is not possible to bind it since it is readonly.
I don't want to use SelectedDatesChanged="Calendar_SelectedDatesChanged" since I use MVVM pattern.
Any advice on how to get a startDate and an endDate from one Calender? I don't have to set the dates, just get them.
Thanks in advance.
|
|
|
|
|
A lot of the WPF controls (as of .NET 4.0) are missing support for binding multiple selection. ListView / ListBox is another big one. You need to implement this yourself. I've done it on the ListView, but you could follow the same pattern:
1) derive CalenderEx class from Calender
2) add IList SelectedDatesEx dependency property
3) monitor changes to SelectedDates AND SelectedDatesEx collection
4) when changes occur in one collection, you simply mirror the changes in the other collection
Bam! you've got a bindable SelectedDatesEx property you can CLEANLY use with MVVM.
There are a few gotchas you need to watch out for when syncing up the lists, but its pretty trivial. I.e. if list1 notifies you of a change, you add the item to list2, but now list2 has raised a change event, so you have to be careful you don't try to add this to list1 again. Basically, block re-entrancy.
|
|
|
|
|
I'll have a look at your advice.
Thanks a lot!
|
|
|
|
|
Hi,
I would like to install the visual studio 2010 express onto my windows 7 machine.
Can I then start developing in Windows phone 7 using silverlight or do I have to install other things on top of vs2010 express?
Basically, after the install of vs2010 express, can I start devloping in WP7 straight away?
Thanks
|
|
|
|
|
If you want to develop for Windows Phone 7 using the express version, then you need the
VisualStudioExpress2010ForWindowsPhone.
All the other dependency stuff will be installed such as the .net framework and so on(if you don't already have them).
All the best,
Dan
modified on Wednesday, August 24, 2011 11:37 AM
|
|
|
|
|
Is it still ok that I already have vs2010 express, sql server 2008 express?
So installing from the link you sent will not interfere with the softwares I mentioned which I already have?
Thanks
|
|
|
|
|
It shouldn't. IF you have wewen(win 7) most definitely it will be fine.
All the best,
Dan
|
|
|
|
|
|
Hi all,
I am trying to show a video clip after the user clicks on a thumbnail image. I tried 3 ways already, without joy
1) I included the video as a resource in the project – but it took too long to load, obviously
2) I tried the following line, which opens the video nicely , but in another browser window
System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("http://youtu.be/code_for_video"), "", "toolbar=1,menubar=1,resizable=1,scrollbars=1,top=0,left=0");
3) I tried the following line, which doesn’t work
htmlHost.SourceUri = new Uri("http://youtu.be/code_for_video");
I am doing something wrong? Am I missing something essential? Should I try something else?
I want to show the video in something like an iframe, but I can’t get anything worthwhile after numerous Google searches.
I am using Silverlight 3, and Microsoft Visual Web Developer 2010 Express.
Any advise, guidance and suggestions are welcome.
Thanks.
|
|
|
|
|
Try this:
http://www.c-sharpcorner.com/uploadfile/scottlysle/csharpwebvideo04212007133218pm/csharpwebvideo.aspx
|
|
|
|
|
Hey Navin,
Thanks for the prompt reply
I do, however, want to embed the video into my SILVERLIGHT app, and not on the apsx page.
|
|
|
|
|
Hi Mc,
Why you are not trying for YoueTube API? Bcz. if u want to show youtube video, then it will embed that video frame into your page. If you are using silverlight control, then just pass the video url to your media control. Hope it work.
Best of luck!
|
|
|
|
|
I have even tried the VideoBrush today, with no success
See code below.
On page Player:
…
<UserControl.Resources>
<MediaElement x:Name="mediaPlayer" Opacity="0">
<VideoBrush x:Name="brush" SourceName="mediaPlayer"/>
</UserControl.Resources>
…
<Rectangle x:Name="rect">
…
Then from the xaml page where the user clicks on the image to see video clip:
…
player.mediaPlayer.Source = new Uri("http://youtu.be/code_of_video");
player.rect.Fill = player.brush;
…
Please help me!
|
|
|
|