|
Hi John,
In the 3rd line of my post, i have entered the xaml code.. just the first few lines..
Thank You,
Ramm
|
|
|
|
|
Guys,
I am able to scroll it now using <ScrollViewer></ScrollViewer>..
I removed the Height="800" Width="1400" from the xaml code.. its fine now.
Thank you,
Ramm
|
|
|
|
|
Hi,
I have a silverlight application with a login page. I want to check login members against Active Directory members and then redirect them to respective pages. I have done Active directory validation in dot net.But in Silverlight, I am unable to find "System.DirectoryServices" dll. Any help regarding this will be very useful.Thanks in advance .
Gomathi R
|
|
|
|
|
You're not going to be able to use Active Directory in a Silverlight app.
You'll need a Windows-specific solution since Active Directory is Windows specific and
Silverlight is not.
You could possibly use Active Directory on a server, maybe through a WCF or other web
service.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
We had the same challenge. The key is to stand it up behind a secured WCF service. The WCF service can make the call to check active directory and then return the status to the Silverlight client. You'll also want to look into generating a token or some unique way to "tag" the session as authenticated on Silverlight so that subsequent calls don't have to re-authenticate every time.
|
|
|
|
|
hi,
Keep in mind, All the protocolls must be implemented to be accessible from the Silverlight sandbox. As no socket support is available right now, its not possible for 3rd party devs to do that now...
You only could write a webservice proxy and access that proxy from the app. Probably the most easy and approachable way to do it right now.
|
|
|
|
|
what you need to do is to implement a web service that queries the AD and use this web service as a proxy to retrieve AD information
|
|
|
|
|
Hi,
I have two problems which iam listing below:
1.
I need to measure the exact cold start up time for WPF application.
I tried measuring the startup time manually, but its showing very inconsistent value. Sometime its showing 11 sec but sometime 3 secs.
Can anyone please tell me the exact reason for this inconsistency and any way i can measure the exact start up time for the WPF application .
2.Is it possible to measure the startup time module wise, like (Presentation framework loading time, PresentationCore loading time, Windows Base loading time, FontService startuptime an finally application startup time).
Thanks
|
|
|
|
|
If you're concerned about cold start time, this[^] should be your bible.
"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 ,Actually this article talks about only the improvement points for performance. I need to know how exactly to measure the startup time as it shows different value for different trials.
Thanks
|
|
|
|
|
The big problem you've got is that the "best" way to see the times is to instrument the code that you want profiling, and this has an effect on the startup time as well (which can also lead to skewed results if you don't happen to profile the item that is really affecting the startup time).
At the bottom of the blog there's a list of related entries that may well be of some interest to you in helping further your investigation.
"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
|
|
|
|
|
As it boots up, start counting out loud...
One thousand one, one thousand two, one thousand three...
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
I'm just playing around with silverlight, trying to get the hang of it... My question is:
What I would like to do is take:
<param name="initParams" value="text1=TEST,text2=TEST2" />
And add them to a menu item in the xaml such as:
<MenuItem Text="TEST"/>
<MenuItem TEST2="TEST2"/>
I'm trying to achieve a simular effect to:
<?php $result = mysql_query("Mysql query here");
while($data = mysql_fetch_array($result)){
$text = $data["text"];
echo "<MenuItem TEST2=\"$text\"/>";} ?>
Only for one - Silverlight is client side, and two -I don't really know how one would generate the xap file using php...If someone could point me to some references or offer some help I would greatly appreciate it..
Thanks,
Joe
|
|
|
|
|
Hello,
>>echo "<MenuItem TEST2=\"$text\"/>";} ?
You can't write XAML tags like that from PHP. You need to install Silverlight SDK (it's better if you have Visual Studio 2008) in order to compile xap file.
Please read some of the article from this link Silverlight PHP[^]
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
I want to clarify the future of silverlight.
anyone can give comments the difference between HTML5(6...) and Silverlight?
HTML5 should be easy to learn but silverlight may be more powerful?
am I right?
thanks.
|
|
|
|
|
Hi,
I apologize if this is a n00b question, but Binding in SilverLight 3( well XAML) is making my head hurt...
Ok, I have a UserControl x:Name="Root" with a ItemsControl x:Name="List" that I bind with ItemsSource="{Binding Path=Options}" , then I use a DataTemplate which is also a UserControl x:Name="Details" , now I need to pass the object that my "Root" control is bound to through to my "Details" control, how would I do that with XAML binding?
An example with classes:
An Invoice has one or more InvoiceLine (List<InvoiceLine> ) class instances so I bind the Invoice to my root control, and the InvoiceLine to my ItemsControl and display the Line detail in a user control, but I need to pass the Invoice class instance through to the control that displays the lines...
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
Are your detailed control and listing control in same XAML file?
If yes then you can do that way.
View
<UserControl .....
xmlns:viewmodel="......"
>
<UserControl.DataContext>
<viewmodel:YourViewModel>
</UserControl.DataContext>
<DataGrid
ItemSouce="{Binding YourList}"
SelectedItem="{Binding ActiveYourEntity}"
AutoGeneratedColumns="True"
/>
<StackPanel x:Name="Details">
<StackPanel Orentitation="Horizontal">
<TextBlock Text="Field : " Margin="5" />
<Textbox Text="{Binding ActiveYourEntity.Field}" Margin="5" />
</StackPanel>
</StackPanel>
</UserControl>
ViewModel
class YourViewModel : INotifyPropertyChanged{
private ObserverableCollection<YourEntity> yourlist = new ObserverableCollection<YourEntity>();
public ObserverableCollection<YourEntity> YourList {
get{ return yourlist; }
set {
yourlist = value;
SendPropertyChanged("YourList");
}
}
private YourEntity activeYourEntity = new YourEntity();
public YourEntity ActiveYourEntity {
get{ return activeYourEntity; }
set {
activeYourEntity = value;
SendPropertyChanged("ActiveYourEntity");
}
}
//Do something for implementing INotifyPropertyChanged.
}
Entity
class YourEntity : INotifyPropertyChanged {
private string field = string.Empty;
public string Filed {
get{ return field ; }
set {
field = value;
SendPropertyChanged("Filed");
}
}
//Do something for implementing INotifyPropertyChanged.
}
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
Hi Michael,
Thanks for the reply but the answer is no, the UserControl is a seperate XAML file all together... I have managed to work around this by subscribing to the Load event of the child control in the parent control, then using something like ((MyControl)sender).Tag = (Invoice)this.DataContext; , very ugly but seems to work ok'ish...
With the low activity on this thread I'm starting to think that XAML (or SL3) does not allow for this kind of binding, a SERIOUS shortfall in my opinion, this will be a very common requirement in LOB appplications...
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
You can probably use Event Aggregator Pattern or Mediator patten to achieve this. In our project, we are using the Event Aggregator implementation from Prims Framework to deal with this kinda scenero. We used to have MainCRUD.xaml, Listing.xaml and Details.xaml. Listing.xaml and Details.xmal will be shown in MainCRUD.xaml.
There are a few ways to handle it.
Approach #1. MainCRUD will listen the SendPropertyChanged from Listing. If the user select a row, the SelectedEntity property that is binded to the selected item of Datagrid will be triggered the SendPropertyChanged and MainCRUD will get that notification.
Approach #2. use Event Aggregator Pattern or Mediator patten
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
Hi Micheal,
Thanks for the feedback, I would have to dig into this and play.
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
I guess I may be missing the boat entirely here, but aren't you doing something like:
<parentcontrol>
<childlistcontrol>
<datatemplate>
<anothercontrolfromsomewhereelse>
</datatemplate>
</childlistcontrol>
</parentcontrol>
If that's the case, binding is hierarchal, right, so you can do this:
<anothercontrolfromsomewhereelse DataContext="{Binding}"/>
And it will inherit the binding from the parent. Is that what you are looking for or did I misunderstand the question?
|
|
|
|
|
Hi Jeremy,
Thanks for the reply, I think this is what I'm after, I'll play with it and let you know
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
I have the following defined in a (merged) resource dictionary:
<Style TargetType="{x:Type TextBox}">
<Setter Property="BorderBrush" Value="Black" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border x:Name="Bd"
CornerRadius="3"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer x:Name="PART_ContentHost"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" TargetName="Bd" Value="Purple" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="BorderBrush" TargetName="Bd" Value="Purple" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
If I add a TextBox control to a form, it does not use the global style. Why not?
If I put this style into the form's resources section it works. If I try to use it from it's original location in the resource dictionary, it doesn't.
EDIT ===========================
Why was this 1-voted?
"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." - Jason Jystad, 10/26/2001
modified on Tuesday, July 21, 2009 2:33 PM
|
|
|
|
|
John Simmons / outlaw programmer wrote: Why was this 1-voted?
No idea.
John Simmons / outlaw programmer wrote: Why not?
Again, no idea. I've just taken your implementation and added it into a dummy application - it works perfectly for me. What I did was add a ResourceDictionary and then pasted your code in. Then, I added the ResourceDictionary into app.xaml like this:
<Application x:Class="ThemeTester.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Window1.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Dictionary.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application> Finally, I added a textbox into a window and it worked perfectly. The only things I can think of are:
1. You haven't merged the resource dictionary in, or
2. You have another style that's being loaded after this one that's overriding the style.
The way to test if it's point 2 is to add this style into a resource dictionary and merge it in as the last style. If it's this problem, the style will start to render properly.
"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
|
|
|
|