|
Your question indicates a total lack of knowledge about the field. I strongly suggest you get a "how to" book on .net programming (possibly a for dummies one may be useful) and start working through it. Make sure you get the most basic one you can find as then it will not make any assumptions on your knowledge level.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Well, as you've posted this in the Silverlight/WPF forum perhaps you are considering using Silverlight. Or, have you just picked a forum at random?
|
|
|
|
|
ASP.Net is a set of technologies. Visual Studio, using either C# or VB.Net, is an integrated development environment and toolset for working with ASP.Net technologies. I recommend some of the beginner tutorials. You can build ASP.Net applications using the free Visual Studio Express editions, specifically Visual Web Developer, and use SQL Server Express for your database, all free of charge and with much of the same power as the full versions, at least at the level you'll be starting out. I recommend a site like www.LearnDevNow.com or any of the lovely tutorials found at www.asp.net to familiarize yourself with all of the tools.
Good luck!
Lisa Z. Morgan
Lairhaven Enterprises
|
|
|
|
|
Hi,
I have a Combobox control in my application, where i need to display multiple data from code like "Value","function" and etc.
can u tell me how to create it in a code..
and if the user select "Value" from that combobox item, i have to display a text box next to that combobox in my WPF application, or else if the user select "Function" from that combobox, it has to display an text box and combobox next to that combobox in the application, but i have to create this control programmatically..
So will u tell me, how can i do this.. any example will be more helpfull...
Thanks
Rocky
|
|
|
|
|
Rocky004 wrote: but i have to create this control programmatically
Why do this, you should control the visibility of the controls based on the selected item of the combobox.
Have 3 properties in your code (VM or codebehind)
SelectedComboItem
FunctionVisible
ValueVisible
When the selected item changes then set the properties as desired, make sure you use onpropertychange event in your code and the xaml will magically change visibility.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I cant design like this,
because both the controls for Value Type and Function Type will have appear in the same position based on user selection..
I will tell u in brief,
i have a combobox where i have to show this "Value" and "Function" Type data at Grid.Column=6 and Grid.Row=5,
When i select Value Type from that Combobox, the next combobox has to appear at Grid.Column=7 and Grid.Row=5,
or if i select Function Type from that combobox, the text box has to appear at Grid.Column=7 and Combobox has to appear at Grid.Column=8 and Grid.Row=5..
So will u pls tell me how to do it...
Thanks
Rocky
|
|
|
|
|
Rocky004 wrote: I cant design like this,
Why not, it is the way SL/WPF is meant to be used.
In you explanation I see no reason not to create the controls in xaml and just change the visibility at runtime based on the user selection.
You are dealing with a mildly complex UI requirement, you are making it difficult by trying to impose winforms type design requirements.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
http://blogs.msdn.com/b/mrochon/archive/2008/06/15/custom-data-and-dynamic-templates-in-wpf.aspx
|
|
|
|
|
I'm having some difficulty trying to use RoutedEvents. I'd guess this one here is easy for someone who has already done it. I'm making a 'paged' application where I'd like a completed action on one of the pages (one container) to allow changing of some content on another container or the main Window. So based on what I've read (been studying this stuff for 4 months now but apparently that's not enough), to do it correctly I should use 'RoutedEvents' to fire an event from the 'page' that goes up the container hierarchy to the main window. From there I can simply set the content within the other container. In any case, the source and target containers aren't in the same container 'chain'. I've put all what seems like the right code in and there are no errors except the event never gets fired in the main window. The problem seems all in the code behind (event not firing?). I'm not sure but I believe I've set up the handler and listener in an acceptable way based on everything I can find in reading the msdn. All the code gets executed (based on tracing through with breakpoints) but the UpdateStatusBar() method on the main window never gets fired when the RaiseEvent is triggered in the SelectDataset() method within the page. Perhaps I'm missing some fundamental understanding about the WPF definition of "point A to point B"?
For easy viewing, I've only posted the meaningful parts of the code. Here is what I have so far:
namespace BlahBlah
{
public partial class pageCfgBrushes : Page
{
public static readonly RoutedEvent BrushSelectionChangedEvent =
EventManager.RegisterRoutedEvent("BrushSelectionChanged", RoutingStrategy.Bubble,
typeof(RoutedEventHandler), typeof(pageCfgBrushes));
public event RoutedEventHandler BrushSelectionChanged
{
add { AddHandler(BrushSelectionChangedEvent, value); }
remove { RemoveHandler(BrushSelectionChangedEvent, value); }
}
public pageCfgBrushes()
{
InitializeComponent();
}
private void SelectDataset(object sender, SelectionChangedEventArgs e)
{
RaiseEvent(new RoutedEventArgs(BrushSelectionChangedEvent));
}
}
}
namespace BlahBlah
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
navContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
navContent.Navigate(new pageMain());
pnlStatusArea.AddHandler(pageCfgBrushes.BrushSelectionChangedEvent, new RoutedEventHandler(UpdateStatusBar));
}
private void UpdateStatusBar(object sender, RoutedEventArgs e)
{
this.StatusBlockMsg.Text = "DataChanged Event";
}
}
}
Sure does take a lot to get working with this WPF in any meaningful way.
Thanks in advance for any help with this.
modified on Tuesday, February 22, 2011 5:28 AM
|
|
|
|
|
Figured out the problem. I changed the line:
pnlStatusArea.AddHandler(pageCfgBrushes.BrushSelectionChangedEvent, new RoutedEventHandler(UpdateStatusBar));
to:
this.AddHandler(pageCfgBrushes.BrushSelectionChangedEvent, new RoutedEventHandler(UpdateStatusBar));
And it works.
So... In trying to evaluate what happens here (so we can learn from it), apparently the original code line sets up a listener in the visual tree level of the pnlStatusArea but we then don't receive the event at the 'this' level of the visual tree. Or at least were not 'listening' for it at the 'this' level.
If anyone with more experience with this can elaborate or comment further about the details and rules of this stuff, it will be appriciated. I'd love to see a good article about this with cartoons and such. I know theres some articles out there but I haven't come across one that focuses on just this type of configuration without going into all sorts of other aspects of routed events that just gets confusing to the interested points here.
Thank You
|
|
|
|
|
I get a feed from Microsoft Silverlight and they keep sending me posts from as far back as 2008. Wondering if anyone else (who subscribes to their feed) is getting them or if there is just something weird about my subscription. I mean who really cares about Silverlight 1.1 any more.
Thanks
"You get that on the big jobs."
|
|
|
|
|
I'snt there any way to unsubscribe?
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
I could unsubscribe but then I won't get the new posts either. I was just curious to see if anyone else was having the same problem.
"You get that on the big jobs."
|
|
|
|
|
hi,
i am looking for an easy way to draw a pitch circle in wpf, based on center coordinates, radius, start angle and end angle.
i really searched quite a time, but all I found was either extrem complex, or does not work.
i would be very thankful, if someone could give me an example or hint to solve my problem.
best regards
pet
|
|
|
|
|
You could start from here[^].
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
I have a Winform App .net framework 3.5 that makes large use of GDI+ system.drawing.drawing2D libary and I want to host it in a web page.
I think I should migrate it to Silverlight so I'm looking for some articles/examples that help me evaluate if this is the right approach.
I'm very new in Silverlight. I googled and found that system.windows.shapes library should be the library to use in Silverlight.
I also found WritableBitmapEX from Codeplex as a different possible library.
QUESTION: Is Silverlight the right solution to get the new app hosted in a web page?
Is there some example that can help me in converting the Winform GDI+ program login in Silverlight?
thanks
|
|
|
|
|
GDI / GDI+ are not used in Silverlight / WPF. Do NOT use WritableBitmap. It is VERY slow. If you are going to go to Silverlight, throw out your code and do it right. Silverlight is a whole new ball game. You don't do stuff at the pixel level anymore. Silverlight has a bunch of shape primitives that you piece together. Line, circle, rect, etc.
|
|
|
|
|
As I said I'm very new of Silverlight and even WPF so I'm trying to understand wich approach could solve my problem.
From my undestanding you are suggesting me to rewrite my GDI+ calls and all the program logic around using Silverlight Shape library as the better solution. Is that correct?
Take a look at this http://writeablebitmapex.codeplex.com. What do you think about?
|
|
|
|
|
As I said, do NOT use that if you are going Silverlight / WPF. VERY bad idea.
1) it is very slow
2) it defeats the whole purpose of Silverlight / WPF.
You need to understand Silverlight / WPF at the CONCEPTUAL level before you even consider it.
In GDI / GDI+ you piece together / GUIs at the pixel level and it all gets drawn on a single surface / off screen DC / double buffered, etc.
No such concepts in Silverlight / WPF. You piece together GUIs at the OBJECT level (controls & shapes) and you end up with a LAYERED SURFACE.
In GDI you draw a rectangle on screen and then draw another rectangle on top... now you have a flat surface with no idea of whats there. Its just pixels.
In WPF / SL, they remain as layered objects so you can move / resize / show / hide / animate / rotate / etc.
In WPF / SL you do your GUI in pretty much all XAML and only do business logic in the code behind.
So in answer to your question, you don't port GDI code to SL, you dump it and rewrite in XAML .
|
|
|
|
|
This article may be an interesting read - http://niknak.org/blog/631-say-goodbye-to-gdi-on-the-web[^].
AFAIK. there is no automated tool that does this.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
|
Thanks for your samples and thaks to everybody. Very clear the different approaches GDI/Silverlight. OK I have to learn xaml and rewrite my gdi app.
But just a more question: In order to host on a web page a painting App like mine (drow lines, draw images, interact with mouse) and having to re-write the old App in another language/environment, is Silverlight the only right solution or may be Javascript or what else.
Having to experiment one more environment is Silverlight the winning solution?
I understand this is a very generic question, but may be you can help me with your experience.
Thanks
|
|
|
|
|
I have the following class
namespace WpfDataTemplate
{
public class Rung : UIElement
{
public int RungNumber { get; set; }
}
}
and the following XAML
<Window x:Class="WpfDataTemplate.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfDataTemplate"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<StackPanel.Resources>
<DataTemplate DataType="{x:Type local:Rung}">
<Grid VerticalAlignment="Top" MinHeight="60" MinWidth="175">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75"/>
<ColumnDefinition MinWidth="175"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" x:Name="number" Text="{Binding RungNumber}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Path x:Name="LeftRail" Data="M0,0 L0,60" Stretch="Fill" Stroke="Blue" Width="1" HorizontalAlignment="Left" Grid.Column="1"/>
<Path x:Name="RightRail" Data="M0,0 L0,60" Stretch="Fill" Stroke="Blue" Width="1" HorizontalAlignment="Right" Grid.Column="1" Margin="0,0,10,0" />
<Path x:Name="Run" Data="M0,0 L10,0" Height="1" Stretch="Fill" Stroke="Blue" Grid.Column="1" VerticalAlignment="Top" Margin="0,30,10,0"/>
</Grid>
</DataTemplate>
<local:Rung x:Key="newRung" />
</StackPanel.Resources>
<StackPanel Height="50" Orientation="Horizontal">
<Button Height="24" Content="Add Rung"/>
</StackPanel>
<ContentControl Content="{StaticResource newRung}"/>
</StackPanel>
</Window>
I want to add a click handler to the button that will add an instance of the class to the MainWindow, but it doesn't work.
private void Button_Click(object sender, RoutedEventArgs e)
{
Rung r = new Rung {RungNumber = 1};
RungSurface.Children.Add(r);
}
Can anyone help?
Thanks,
Jim
|
|
|
|
|
I can't see anywhere in the xaml where the RungSurface in bound.
"You get that on the big jobs."
|
|
|
|
|
I got confused with all the path stuff and the use of the local as a datacontext.
I would think he should change the underlying datacontext, presumably an observablecollection.
Never underestimate the power of human stupidity
RAH
|
|
|
|