|
hmm nope,
I got my problems solutions ..
<ItemsControl ItemsSource="{Binding ConfiguredViews}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<panels:FishEyePanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
here is what I was thinking.
Thanks for bothering :P
Moim Hossain
R&D Project Manager
BlueCielo ECM Solutions BV
|
|
|
|
|
Hi,
i need to create a software (about restaurant,hotel,etc..etc..),
an important request i received from my manager is to create a Forms Authentication with many different Login and Passwords where each user will get a different privilege to restrict the access.
An example:
- Login = guest ...can only access to the software without delete,add or edit the data.
- Login = adminstrator ... can do everything .
- Login = employee 01 ... can access to the software but can delete,add and edit just some (specific) data.
- Login = employee 02 .... can access to the software but can delete,add and edit just some (specific) data.
..... and so on ...
This software will be used in 5 different department in my office so each department will have different privilege/permission to access in the software.
Now i have not a clear idea to develop this feature ,never i made it as my knowledge are poor.
I will use SqlServer 2005 for the database ,Linq toSql and Wpf(interface) of course so i thought to create a table with SqlServer as follow:
CREATE TABLE [dbo].[TblLogin] (
[Name] [varchar] (30) ,
[username] [varchar] (20),
[password] [varchar] (20) ,
[Email] [varchar] (50) ,
[Roles] [varchar] (50)
)
GO
but after i get stuck i don't know how go ahead
If you have any idea/suggestion let me know it will be so useful for me,i'm available to learn ...i have a lot of thing to learn .
Have a good job.
Nice Regards,
Bye
|
|
|
|
|
Well, you could always use the MembershipProvider and RolesProvider classes. To use these, you need to add the relevant tables into SQL Server (added by the command aspnet_regsql[^]). Then, you need to add a System.Web entry into your config file, and add the MembershipProvider and RoleProvider sections in here. That's it - you now have access to a role mechanism. It's up to you to provide the login screen and admin screens, but that should be fairly trivial.
|
|
|
|
|
Hi Pete
for my poor knowledge never i used a System.Web in past time so i have some question to understand better what i need to do but before to post my question do you have some link to show me so i can ask not foolish question.
Thanks my friend
Have a nice job.
Bye
|
|
|
|
|
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
|
|
|
|
|