|
Here's a sample of what would go in your config file:
<system.web>
<membership defaultProvider="AspNetSqlProvider" />
<roleManager enabled="true" defaultProvider="AspNetSqlProvider" />
</system.web>
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="
data source=(local);Integrated Security=SSPI;
Initial Catalog=aspnetdb" />
</connectionStrings>
|
|
|
|
|
Hi Pete,
sorry if i ask you many question but when i don't understand i can not go ahead....
I tried your advice it is right , now i have the aspnetdb.mdf in my WPF project.
Sincerily i have not experience about Roles and MembershipProvider so i ask you if you have some link where learn some step to go ahead ...
Thanks a lot .
Have a nice wake up.
Bye
|
|
|
|
|
If you can wait a couple of days, I'm writing a RoleManager in WPF application that I will be posting up (possibly as an article - or possibly on my blog), which will provide a fairly complete implementation that demonstrates how to use Roles and the Membership API, especially with regards to the MVVM pattern. Trust me - all becomes clear when you see the code.
If you can't wait that long, you can get some ideas from here[^] and here[^] (note you need to add a reference to System.Web to your application to get this to work).
|
|
|
|
|
Hi Pete,
Pete wrote:
If you can wait a couple of days, I'm writing a RoleManager in WPF application that I will be posting up (possibly as an article - or possibly on my blog), which will provide a fairly complete implementation that demonstrates how to use Roles and the Membership API, especially with regards to the MVVM pattern. Trust me - all becomes clear when you see the code.
..It's a fantastic news ,after i will read better about the links above meantime i will wait your article with a big hug .
Thank a lot
Have a nice job.
Bye
|
|
|
|
|
Just to let you know I haven't forgotten about this code. I'm still working on it, and it's coming on quite nicely. Hopefully you can learn a lot from the implementation - it's all done using MVVM, and it should help to clarify a lot of those issues for you as well as show you how to use the Membership and Roles API.
|
|
|
|
|
Hi Pete,
i'm happy for your care and support and i'm waiting with trust your next project.
Sure i will learn a lot... i need to learn and study a lot
However i wish you a nice work and thanks a lot for your precious support .
Nice regards,
Bye
|
|
|
|
|
Hey everyone,
I am doing my first WPF User control. I am trying to get my hyperlink to open a new IE browser when I press a on my "link label".
my code sampel;
<DataTemplate x:Key="resultLayout" DataType="WPFSearchResult">
<StackPanel Orientation="Vertical">
<TextBlock Foreground="Blue">
<Hyperlink Name="hl" RequestNavigate="HandleRequestNavigate" FontSize="14" NavigateUri="http://www.microsoft.com">
<TextBlock Text="{Binding Path=Header}"/>
</Hyperlink>
</TextBlock>
</StackPanel>
</DataTemplate>
When I press on the HyperLink nothing happen.
This is a sampel of my code behid class;
namespace WpfShowResultsControl
{
public partial class GetSearchResultUserControl : UserControl
{
public GetSearchResultUserControl()
{
InitializeComponent();
}
void HandleRequestNavigate(object sender, RoutedEventArgs e)
{
string navigateUri = hl.NavigateUri.ToString();
Process.Start(new ProcessStartInfo(navigateUri));
e.Handled = true;
}
}
}
I have tried many eksampels on diffrent forums and I cannot get it works. I have also tried like this <Hyperlink x:Name="hl".....>
In my code behind class, I cannot use hl, it looks like it does not exist. What can I do to get hl useable? Could any one please advice me what I am missin in my code. Many thanks in advance!
|
|
|
|
|
hi
you can try this:
make an click event on you textblok.
and in you click event call:
System.Diagnostics.Process.Start("http://www.google.de");
|
|
|
|
|
From [^]
"Hyperlink is "navigation service" aware, which means it can work properly as you expect in navigation application(using NavigationWindow, Frame which can provide navigation service).
In standalone non-navigation application, you can hook up to its Click event, and implement the navigation logic there."
So, in your case you will need to use click handler as suggested ^^
|
|
|
|
|
I hope you found this useful :
private void Windows_Loaded(object sender, RoutedEventArgs e)
{
AddHandler(Hyperlink.ClickEvent, (RoutedEventHandler)Hyperlink_Click);
}
private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is Hyperlink)
{
Process.Start((e.OriginalSource as Hyperlink).NavigateUri.AbsoluteUri);
e.Handled = true;
}
}
|
|
|
|
|
Hi Guys,
Any one has idea on how to host a workflow designer inside a ASP.NEt page.
Thanks in advance for your suggestions
Sree
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
This[^] might serve as a starting point.
|
|
|
|
|
Thank you pete.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Hi
I am trying to create and start an animation in code instead of using xaml. When I use the Storyboard object(second example) nothing happens(There are no visible results of the animation), if I set animation's properties and start it without using the Storyboard object everything works normaly(first example). Below is the sample code which is put in the event handler for a button which is on the UserControl.
//This works normaly
btn_Click(object sender, RoutedEventArgs e)
{
LinearGradientBrush mask = new LinearGradientBrush();
GradientStop transparentStop = new GradientStop(Colors.Transparent, 0);
GradientStop visibleStop = new GradientStop(Colors.Black, 0);
mask.GradientStops.Add(transparentStop);
mask.GradientStops.Add(visibleStop);
this.OpacityMask = mask;
DoubleAnimation visibleStopAnimation = new DoubleAnimation(0, 1.2, TimeSpan.FromSeconds(1.2), FillBehavior.HoldEnd);
visibleStop.BeginAnimation(GradientStop.OffsetProperty, visibleStopAnimation);
}
//This doesn't work
btn_Click(object sender, RoutedEventArgs e)
{
LinearGradientBrush mask = new LinearGradientBrush();
GradientStop transparentStop = new GradientStop(Colors.Transparent, 0);
GradientStop visibleStop = new GradientStop(Colors.Black, 0);
mask.GradientStops.Add(transparentStop);
mask.GradientStops.Add(visibleStop);
this.OpacityMask = mask;
Storyboard story = new Storyboard();
story.Duration = TimeSpan.FromSeconds(1);
DoubleAnimation visibleStopAnimation = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(1), FillBehavior.HoldEnd);
Storyboard.SetTarget(visibleStopAnimation, visibleStop);
Storyboard.SetTargetProperty(visibleStopAnimation, new PropertyPath("(Offset)"));
story.Children.Add(visibleStopAnimation);
story.Begin();
}
Does anybody has any idea? Any advice will be appreciated!
Uros
|
|
|
|
|
When you work with Storyboards in code you need to use RegisterName. You can learn more about the "why" here:
Storyboards Overview (MSDN)[^]
LinearGradientBrush mask = new LinearGradientBrush();
GradientStop transparentStop = new GradientStop(Colors.Transparent, 0);
GradientStop visibleStop = new GradientStop(Colors.Black, 0);
mask.GradientStops.Add(transparentStop);
mask.GradientStops.Add(visibleStop);
this.OpacityMask = mask;
NameScope.SetNameScope(this, new NameScope());
this.RegisterName("visibleGradientStop", visibleStop);
DoubleAnimation visibleStopAnimation = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(1), FillBehavior.HoldEnd);
Storyboard story = new Storyboard();
story.Duration = TimeSpan.FromSeconds(1);
story.Children.Add(visibleStopAnimation);
Storyboard.SetTargetName(visibleStopAnimation, "visibleGradientStop");
Storyboard.SetTargetProperty(visibleStopAnimation, new PropertyPath(GradientStop.OffsetProperty));
story.Begin(this);
|
|
|
|
|
Thank you gurge60, that solved my problem.
|
|
|
|
|
Hello All, I'm kinda new in this field and want your help.
The problem is, that I want to create a custom treeview and I want that treeview to take it's template ,styles and setters from a dictionary, and do that in a "WPF CustomControl Library" (project type)
how can I do That ?
Thanks in advance
|
|
|
|
|
Do you have Blend? When you create a template Blend asks you where you want to define it. You can then choose to define it in a resource dictionary.
If not using Blend, I think you just define the template or style in the resource dictionary, then reference it in the XAML.
|
|
|
|
|
Hi there,
first of all: I'm quite new to WPF. The current project is to help me learn working with it.
I'm trying to make a window that is much like an ICQ window: http://bb.nfshost.com/icqNormal.jpg[^].
Items in there shall be collapsable like this: http://bb.nfshost.com/icqCollapsed.jpg[^]. I'd like to use Expander to achieve this.
Now, on to my problem(s). I want it all to size to the content. For the main window that's simple, as I found the SizeToContent="WidthAndHeight" property.
For the rest, well, I was trying around a few hours without any working results. Currently, my XAML looks like this:
<Grid>
<DockPanel Margin="0,0,78,0" Name="dockPanel1" VerticalAlignment="Top">
<Expander Header="test 1" Name="expander1">
<Grid>
<StackPanel Name="stackPanel1">
<Label Height="28" Name="label1" Width="120">Label2</Label>
<Label Height="28" Name="label2" Width="120">Label2</Label>
<Label Height="28" Name="label3" Width="120">Label2</Label>
<Label Height="28" Name="label4" Width="120">Label2</Label>
</StackPanel>
</Grid>
</Expander>
</DockPanel>
<DockPanel Margin="0,0,78,169" Name="dockPanel2" VerticalAlignment="Bottom">
<Expander Header="test 2" Name="expander2" VerticalAlignment="Bottom">
<Grid>
<StackPanel Name="stackPanel2">
<Label Height="28" Name="label5" Width="120">Label 0</Label>
<Label Height="28" Name="label6" Width="120">Label 0</Label>
<Label Height="28" Name="label7" Width="120">Label 0</Label>
<Label Height="28" Name="label8" Width="120">Label 0</Label>
</StackPanel>
</Grid>
</Expander>
</DockPanel>
</Grid>
Note: The content is supposed to be unknown, and variable in size.
What this sadly does, is put both expanders in the same place, covering each other. Anyone there who might help me out?
Thanks in advance
|
|
|
|
|
Well, this works for me:
<StackPanel Orientation="Vertical">
<DockPanel Name="dockPanel1" VerticalAlignment="Top">
<Expander Header="test 1" Name="expander1">
<StackPanel Name="stackPanel1">
<Label Height="28" Name="label1" Width="120">Label2</Label>
<Label Height="28" Name="label2" Width="120">Label2</Label>
<Label Height="28" Name="label3" Width="120">Label2</Label>
<Label Height="28" Name="label4" Width="120">Label2</Label>
</StackPanel>
</Expander>
</DockPanel>
<DockPanel Name="dockPanel2" VerticalAlignment="Bottom">
<Expander Header="test 2" Name="expander2" VerticalAlignment="Bottom">
<StackPanel Name="stackPanel2">
<Label Height="28" Name="label5" Width="120">Label 0</Label>
<Label Height="28" Name="label6" Width="120">Label 0</Label>
<Label Height="28" Name="label7" Width="120">Label 0</Label>
<Label Height="28" Name="label8" Width="120">Label 0</Label>
</StackPanel>
</Expander>
</DockPanel>
</StackPanel>
|
|
|
|
|
Or you could put it in a Grid and get rid of the VerticalAlignments:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" Margin="0,0,78,0" Name="dockPanel1" >
<Expander Header="test 1" Name="expander1">
<Grid>
<StackPanel Name="stackPanel1">
<Label Height="28" Name="label1" Width="120">Label2</Label>
<Label Height="28" Name="label2" Width="120">Label2</Label>
<Label Height="28" Name="label3" Width="120">Label2</Label>
<Label Height="28" Name="label4" Width="120">Label2</Label>
</StackPanel>
</Grid>
</Expander>
</DockPanel>
<DockPanel Grid.Row="1" Margin="0,0,78,169" Name="dockPanel2" >
<Expander Header="test 2" Name="expander2" >
<Grid>
<StackPanel Name="stackPanel2">
<Label Height="28" Name="label5" Width="120">Label 0</Label>
<Label Height="28" Name="label6" Width="120">Label 0</Label>
<Label Height="28" Name="label7" Width="120">Label 0</Label>
<Label Height="28" Name="label8" Width="120">Label 0</Label>
</StackPanel>
</Grid>
</Expander>
</DockPanel>
</Grid>
modified on Wednesday, March 25, 2009 6:52 PM
|
|
|
|
|
Hi,
I tried to use ApplicationCommands.Paste for a web browser application but it doesn't work. I used this command for window application and it worked. Is there anyone who has an idea to solve this problem. Thanks.
|
|
|
|
|
This is not a paid support forum - please don't attempt to push your post to the top when you've published the same one so recently. It's not good form.
|
|
|
|
|
If you dont have an answer why are you making comment. I am aware this isn't a paid support forum. I just want to solve a problem and get some help. I dont get what is wrong with it.
|
|
|
|
|
The etiquette of the forum is that you don't bump posts. The reason that people haven't answered your original post can be many and varied, perhaps the person who can answer it hasn't got round to viewing it yet, or perhaps the wording isn't done particularly well and people can't understand it, or perhaps somebody is putting text together to answer it, but hasn't gotten around to post a sample yet.
In any of these cases, you are doing other posters a disservice when it comes to your bumping your post. Suppose everybody decided to do this - it would become impossible to answer questions properly because you couldn't get a dialogue going with somebody because their post would disappear under a blizzard of crap.
|
|
|
|