稳扎稳打Silverlight(29) - 2.0Tip/Trick之Cookie, 自定义字体, 为程序传递参数, 自定义鼠标右键, 程序常用配置参数
2009-05-21 12:08:20 来源:WEB开发网InitParams.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace Silverlight20.Tip
{
public partial class InitParams : UserControl
{
public InitParams()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(InitParams_Loaded);
}
void InitParams_Loaded(object sender, RoutedEventArgs e)
{
// 以编码的方式读取应用程序级别的资源
lblMsg.Text += App.Current.Resources["key1"];
}
}
}
4、演示如何响应并处理鼠标右键事件
为 Silverlight 插件配置参数,windowless="true"
<param name="windowless" value="true" />
RightClick.xaml
<UserControl x:Class="Silverlight20.Tip.RightClick"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Border BorderBrush="Black" BorderThickness="4" Background="Bisque" Width="100" HorizontalAlignment="Left">
<!--右键菜单的内容-->
<StackPanel>
<TextBlock Margin="5">我是右键菜单1</TextBlock>
<TextBlock Margin="5">我是右键菜单2</TextBlock>
<TextBlock Margin="5">我是右键菜单3</TextBlock>
</StackPanel>
<!--右键菜单的位置-->
<Border.RenderTransform>
<TranslateTransform x:Name="tt" />
</Border.RenderTransform>
</Border>
</UserControl>
Tags:稳扎稳打 Silverlight Tip
编辑录入:爽爽 [复制链接] [打 印]- ››silverlight全屏显示图片
- ››Silverlight MVVM 模式(一) 切近实战
- ››稳扎稳打Silverlight(53) - 4.0通信之对WCF NetTc...
- ››稳扎稳打Silverlight(54) - 4.0通信之对UDP协议的...
- ››稳扎稳打Silverlight(55) - 4.0通信之对UDP协议的...
- ››稳扎稳打Silverlight(56) - 4.0通信之与 WCF Data...
- ››Silverlight for Windows Phone 7开发系列(1):...
- ››Silverlight for Windows Phone 7开发系列(2):...
- ››Silverlight for Windows Phone 7开发系列(3):...
- ››Silverlight for Windows Phone 7开发系列(4):...
- ››Silverlight for Symbian
- ››Silverlight3系列(四)数据绑定 Data Binding 1
更多精彩
赞助商链接