|
devvvy wrote: On contrary, ASP.NET require plug-in and Silverlight/ASPNET are alternatives, competiting technologies. But, Silverlight again does not replace ASP.NET.
I don't know a thing about asp.net beyond what I need to host my Silverlight applications.
My understanding is asp.net code runs server-side.
Silverlight apps run on the client within the Silverlight browser plugin.
I wouldn't call them competing technologies - I'd call them different technologies.
The Silverlight plugin can be used within asp.net pages (or any other web pages) much
the same as flash player is used.
Me personally, not knowing anything about HTML/ASP.NET programming, I just use a simple page
to host my Silverlight apps in the full browser window.
devvvy wrote: By WBA I meant WPF "Web Browser Application"
Those are commonly called WPF XBAPs (XAML Browser Applications) which will help you find much more info on them
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thanks
XBAP's - they can be served by IIS? I just ran it it pops under my browser Firefox but it's a local disk file. Are they best served and made available via file share/shared drive on intranet? Since XBAP requires .NET 3.5 installed on clientside then... why not just go silverlight even for intranet scenario? Is XBAP irrelevant because we have Silverlight?
I can see we need client side WPF but not XBAP
dev
|
|
|
|
|
You can publish XBAPs to an IIS server or any other web server.
ClickOnce deployment is used to download and install the XBAP behind the scenes.
Windows Presentation Foundation XAML Browser Applications Overview[^]
Deploying a WPF Application (WPF)[^]
Silverlight uses its own stripped down .NET framework, which has implementations
for other platforms (Mac and Unix-via-mono so far).
I think WPF XBAPs are more appropriate for corporate/enterprisey networks.
The requirement for .NET 3.x+ framework makes them useless for cross platform
situations. However, if you know all your clients will have .net 3.5 and be running on Windows,
then an XBAP can make more sense since it has access to the full .NET framework, and WPF
has a much richer XAML implementation than Silverlight does.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
From what I see - Silverlight can do even sockets it can allow very interactive experience. Even stock/derivative trading apps where client need to subscribe to constants/intensive price/pnl/others updates can be done with Silverlight, without requirement on .NET framework 3.x+.
I don't see any ... application for XBAP really...
dev
|
|
|
|
|
devvvy wrote: I don't see any ... application for XBAP really...
Me neither.
I've never done one, but I can see where with a corporate app on a corporate network
it keeps all the deployment/update issues on the server end which is much easier than
dealing with even ClickOnce manually.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
cheers, thanks for patience.
I'm getting my hands dirty with Silverlight for the first time today.
dev
|
|
|
|
|
I want to create a list of hyperlink buttons, and the bulleted list should contain some images before the link.
For example
> how
> can
> i
> get
> this
So in place of ">" i need different images, how can i do that in Silverlight?
Thanks in advance,
|
|
|
|
|
Here's one way:
<HyperlinkButton NavigateUri="http://www.microsoft.com" TargetName="_blank" >
<StackPanel Orientation="Horizontal">
<Image Source="myresourceimage.png" />
<TextBlock Text="Microsoft" />
</StackPanel>
</HyperlinkButton>
You could also make your own custom HyperlinkButton:
HyperlinkButton Styles and Templates[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for ur response ...
It worked..
|
|
|
|
|
I've inherited some code that has a WPF UI. It was running great on Vista, but I've just installed Visual Studio 2008 on an XP machine and built and ran that application and the main window still looks okay, but the dialogs all come up completely transparent, with no borders and most of their controls missing. One of the dialogs, for instance, contains a grid, two buttons (OK, Cancel), some labels, a couple of calendar controls, a combobox and a widget in the lower right corner for sizing the dialog window. The only things that are visible are the labels, the combobox and the window sizing widget. I've discovered that if I can guess the locations of the buttons correctly, clicking on them works, so they're there. I'm not getting any exceptions at runtime, so I'm baffled. I've tried reinstalling Visual Studio, and SP1, in the hopes that some WPF dll was out of date, but to no avail. Two other clues: when I select an xaml file and view it in the designer UI, if I have the properties window open and a control selected, when I try to use one of the dropdowns in the properties window to select a color, I get very strange behavior. The dropdown portion of the control initially shows, but if I try to move down in the list, either with the mouse or keyboard, the list disappears, but each item gradually reappears as I move down through the list. So, in otherwords, parts of the Visual Studio UI are also transparent when they shouldn't be. That's why I decided to try reinstalling Visual Studio. Another piece of information: I copied the contents of the Output window in the debugger, when loading the dialog. I did this for both Vista, where everything works, and XP where it doesn't, and compared the lists of things that were loaded. The lists were identical with the exception of the PresentationFramework dlls. Vista used Aero and XP used Luna. I've thought about forcing my application to use Aero, to see if that helps. Any suggestions? Thanks!
|
|
|
|
|
I've seen this behaviour only once before - and it turned out to be an issue with the graphics card thinking that a drag was in effect when it wasn't. Basically, certain graphics cards allow you to treat windows as transparent when being dragged - this may be worth looking in to.
|
|
|
|
|
Thanks. That wouldn't explain why some of the controls (grid, some buttons) don't show up at all though, would it?
|
|
|
|
|
To be honest, I can't really remember all the details - just the fact that a screen went semitransparent on XP for no apparent reason.
|
|
|
|
|
Hi,
I want to create a WPF user control to display an image at runtime.
I want the image size are adapted to those of control.Come can I do this?
PS: Sorry my English.
|
|
|
|
|
|
I’ve just published XAML Power Toys 4.0 here:
http://karlshifflett.wordpress.com/2009/02/10/xaml-power-toys-40-released-code-name-mvvm/[^]
New Features
• Extract properties to a Style allows selecting a control, choosing desired properties and have those selected properties extracted to a newly created style
• Create ViewModel Class from a VB.NET or C# code window. Easily create a ViewModel stub that includes commands and exposed data class.
• Group into GroupBox
• Option to generate x:Name for controls
• Option to add ForeReRead converter to TextBox bindings (both VB.NET & C# converters included in source and binary downloads. Converter is also included in the OceanFramework.WPF namespace.)
• Option to add TargetNullValue to TextBox.Text bindings when Source property is Nullable
• Corrected secondary application domain load issue reported by DevExpress. This fix also solves another edge case secondary application domain load issue.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
I’ve just published XAML Power Toys 4.0 here:
http://karlshifflett.wordpress.com/2009/02/10/xaml-power-toys-40-released-code-name-mvvm/[^]
New Features
• Extract properties to a Style allows selecting a control, choosing desired properties and have those selected properties extracted to a newly created style
• Create ViewModel Class from a VB.NET or C# code window. Easily create a ViewModel stub that includes commands and exposed data class.
• Group into GroupBox
• Option to generate x:Name for controls
• Option to add ForeReRead converter to TextBox bindings (both VB.NET & C# converters included in source and binary downloads. Converter is also included in the OceanFramework.WPF namespace.)
• Option to add TargetNullValue to TextBox.Text bindings when Source property is Nullable
• Corrected secondary application domain load issue reported by DevExpress. This fix also solves another edge case secondary application domain load issue.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Great job Karl. This is fantastic news - you are THE man.
|
|
|
|
|
I am writing a WPF app, and want to have the app minimise to the system tray, the only examples of how to do this involve adding a reference to System.Window.Forms, is adding this reference bad practice or accepted as needed to be done to get some functionality.
Thanks
Mark
|
|
|
|
|
I see no reason to treat this as a bad practice. I have done this exact thing once, and I reference Windows.Forms all the time to get the File Dialogs (I just like the old ones better).
|
|
|
|
|
Hi,
I want to asssociate a BitMap image with the ListboxItems in a WPF Listbox. But I could not find any property in the ListboxItem which can get associated with an image. I am loading the ListBox programatically and want to display images on the listboxitems dynamically.
Could anyone let me know how can i acheive this in the WPF ListBox?
Thanx in advance.
|
|
|
|
|
I would be tempted to do something like this:
<DataTemplate x:Key="MyTemplate">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Grid.Column=1 Width="{Binding myImage.Width}" Height="{Binding myImage.Height}" Source="{Binding myImage}" />
<TextBlock Width="Auto" Grid.Column="1"
Text="{Binding MyTextItem}" />
</Grid>
</DataTemplate> Then, your listbox would look like this:
<ListBox Padding="3" HorizontalAlignment="Left" Width="Auto"
ItemTemplate="{DynamicResource MyTemplate}"
ItemsSource="{Binding Mode=Default, Source={StaticResource MyDataSource}}"
VerticalAlignment="Top" Height="Auto"/>
|
|
|
|
|
Hi Pete,
Thanx for the reply.
My actual requirement is to load the listbox with ToolboxItems. Each ToolboxItem has its own image which i want to associate with the listboxitem when i create a new listboxitem. I tried multiple ways of doing it programatically but unable to get the desired result.
Without using the xaml file how can i add items to the listbox programatically. One of the ways is setting the ItemsSource property to collection containing the items. I could populate a Treeview just by creating new TreeviewItems in the code and adding them to the Treeview.But the same did not happen incase of Listbox, am I missing anything?
Also, I am unable to group items within the listbox, could you please suggest how i can acheive this?
Thanx in adv.
|
|
|
|
|
Hi,
Also, using the DataTemplate given above I am not able to view any image on the Listboxitem. And sometime a XamlParseException is thrown at runtime, which is as follows
connot convert string in attribute 'Source' to object of type 'System.Windows.Media.ImageSource'
Any idea what am I missing? Is it that I cannot load a Bitmap image on the ListBoxItem??
|
|
|
|
|
I have a template and would like to access a UIElement. Because it is a template, it is not an object unless it is a static object. How can I create a static object in a template? The x:Name=”someName” are only to access inside template NOT outside. So we get an error when we try to access from a class. i.e. in constructor I can’t access someName. This also means that I cannot write a function when there is a change.
How this can be done?
Best regards
Agha
<Button x:Class="WpfApplication1.DoubleCharBtn"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Button.Template>
<ControlTemplate>
<Border x:Name="br" Background="Blue" CornerRadius="3" BorderBrush="Black">
<StackPanel Orientation="Vertical">
<TextBlock x:Name="TextUpperChar" HorizontalAlignment="Center" Text="{Binding UpperLetter}" />
<TextBlock x:Name="TextLowerChar" HorizontalAlignment="Center" Text="{Binding LowerLetter}" />
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsPressed" Value="True">
<Setter TargetName="br" Property="Background" Value="Red"/>
<Setter TargetName="TextUpperChar" Property="Background">
<Setter.Value>
<LinearGradientBrush>
<GradientStop Offset="1" Color="DarkBlue"/>
<GradientStop Offset="0.5" Color="Blue"/>
<GradientStop Offset="0" Color="DarkBlue"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
namespace WpfApplication1
{
/// <summary>
/// Interaction logic for DoubleCharBtn.xaml
/// </summary>
public partial class DoubleCharBtn : Button
{
internal static readonly DependencyProperty UpperCharProperty =
DependencyProperty.Register(
"UpperChar",
typeof(char),
typeof(DoubleCharBtn),
new FrameworkPropertyMetadata(' ', FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, UpperCharChanged));
public static void UpperCharChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
char TempChar = (char)e.NewValue;
DoubleCharBtn doubleCharBtn = (DoubleCharBtn)d;
// doubleCharBtn.TextUpperChar.Text = string.Format("{0}",TempChar);
}
public char UpperChar
{
set { SetValue(UpperCharProperty, value); }
get { return (char)GetValue(UpperCharProperty); }
}
internal static readonly DependencyProperty LowerCharProperty =
DependencyProperty.Register(
"LowerChar",
typeof(char),
typeof(DoubleCharBtn),
new FrameworkPropertyMetadata(' ', FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, LowerCharChanged));
public static void LowerCharChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
char TempChar = (char)e.NewValue;
DoubleCharBtn doubleCharBtn = (DoubleCharBtn)d;
// doubleCharBtn.TextLowerChar.Text = string.Format("{0}", TempChar);
}
public char LowerChar
{
set { SetValue(LowerCharProperty, value); }
get { return (char)GetValue(LowerCharProperty); }
}
public DoubleCharBtn()
{
InitializeComponent();
}
}
}
|
|
|
|