|
|
Basically, this binds the data context of the ItemsSource to the data context of the ItemsControl (which works it's way up the visual tree until it finds a data context). This means that the datacontext you are looking for is assigned here:
c.DataContext = (null == c.DataContext) ? _letterDatas : null;
"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
|
|
|
|
|
Hi Guys,
In the general xaml code, i have written as follows,
<pre>Page x:Class="UI_eHTMP.Window1" Title="eHTMP Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="800" Width="1400" Loaded="Window_Loaded" Title="applc1" Background="OldLace"></page></pre>
when I run the appliction and try to restore and Maximize the windows page, i dont see the task bar and vertical and horizantal scroll bars to scroll,
what to be included in the xaml code? Even the title is also not displayed when i have mentioned in the xaml title.
Please help me in resolvign this.
Thank you,
Ramm
|
|
|
|
|
0) I don't see in the XAML you posted where you're telling the window to scroll.
1) Scrollbars are typically set to "Auto" so they only appear when scrolling is needed.
2) Learn how to post code here. It's ALMOST IMPOSSIBLE to read code when it's posted with a proportional font.
"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
|
|
|
|
|
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
|
|
|
|