随笔分类 -  WIN8APP

1
获取messagedialog用户点击的按钮
摘要:private async void Button_Click_1(object sender, RoutedEventArgs e) { MessageDialog msgdlg = new MessageDialog("是否删除?"); msgdlg.Commands.Add(new UICommand("是") { Id = 1 }); msgdlg.Commands.Add(new UICommand("否") { Id = 2 }); var result = awa... 阅读全文
posted @ 2012-12-04 10:48 振宇爸爸 阅读(222) 评论(0) 推荐(0) 编辑
一下其他控件
摘要:<ProgressBar HorizontalAlignment="Center" Height="26" Margin="90,90,0,0" VerticalAlignment="Center"></ProgressBar> <ProgressRing IsActive="True" HorizontalAlignment="Center" Height="26" Margin="90,90,0,0" 阅读全文
posted @ 2012-12-04 10:33 振宇爸爸 阅读(123) 评论(0) 推荐(0) 编辑
APPBAR
摘要:<Page.TopAppBar> <AppBar> <AppBar.Content> <StackPanel Orientation="Horizontal"> <Button>删除</Button> <Button Style="{StaticResource OutAppBarButtonStyle}" AutomationProperties.Name="播放"></Button> </StackPanel> ... 阅读全文
posted @ 2012-12-04 10:14 振宇爸爸 阅读(149) 评论(0) 推荐(0) 编辑
动画Storyboard基础
摘要:前面我们已经说过一些做动画的方法,但是需要指出的是,我们以前用Timer做的动画,没有调优的空间,他的播放频率永远是定死在了你的代码里面,而且当笔记本或平板电脑没有电的时候,操作系统会自动帮我们调慢动画的播出频率,这点,是以前的Timer做不到的,所以这里引出了Storyboard这个东西首先定义一个按钮,定义了两个动画事件 <Button Content="aaa" Margin="20,30,0,0" Click="Button_Click_1" > <Button.RenderTransform> < 阅读全文
posted @ 2012-12-03 17:17 振宇爸爸 阅读(287) 评论(0) 推荐(1) 编辑
自定义值转换器
摘要:当我们在前台写页面的时候,有时候后台给我们的数据并不是现成可用的,我们需要自己再转化一下才可以使用,所以,我们需要创建一个前台的数据转化工具类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Windows.UI.Xaml;using Windows.UI.Xaml.Data;namespace GridExp{ public class BoolVisibilityConverter : IValueCo... 阅读全文
posted @ 2012-12-03 16:56 振宇爸爸 阅读(185) 评论(0) 推荐(0) 编辑
ComboBox使用
摘要:<ComboBox Name="ss" Margin="200,200,0,0" Width="200" Height="50"> <ComboBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Image Source="{Binding Image}" Height="50" Width="50&q 阅读全文
posted @ 2012-12-03 16:08 振宇爸爸 阅读(258) 评论(0) 推荐(0) 编辑
Listview的使用
摘要:protected override void OnNavigatedTo(NavigationEventArgs e) { List<Person> list = new List<Person>(); list.Add(new Person { Name = "321", Age = 33 }); list.Add(new Person { Name = "432", Age = 12 }); list.Add(new Person { Name = "542", Age ... 阅读全文
posted @ 2012-12-03 14:54 振宇爸爸 阅读(143) 评论(0) 推荐(0) 编辑
数据绑定
摘要:OneTime绑定:单次绑定,绑定后数据改变界面不会发生改变OneWay绑定:单向绑定,这个是绑定的默认值,当我们改变数据源的值时,界面上面的值会发生改变,但当我们改名界面上面的值时,数据源数据不会发生变化(Eval)TwoWay绑定:双向绑定,任意一方数据改变都会触发数据源或界面上面的值(BIND)slider 进度滚动条 <TextBox Text="{Binding Value,Mode=TwoWay,ElementName=s1}"/> <Slider Maximum="100" Minimum="0" x: 阅读全文
posted @ 2012-12-03 14:16 振宇爸爸 阅读(143) 评论(0) 推荐(0) 编辑
导航
摘要:Frame.Navigate(typeof(MyPage3));Frame.GoBack(); 这里的Frame就是Page的一个属性带参数跳转Frame.Navigate(typeof(MyPage3),object);//这里的参数OBJ可以是任意形式的参数接受e.Parameterint i=(int)e.Parameter;缓存:当我们导航到一个页面再返回前一个页面的时候,我们需要启用缓存让我们之前的修改进行缓存在构造函数中写(启用缓存)NavigationCacheMode=Navigation.NavigationCacheMode.Enabled导航模式:当一个页面被重新加载后都 阅读全文
posted @ 2012-12-03 11:58 振宇爸爸 阅读(175) 评论(0) 推荐(0) 编辑
变幻:旋转,缩放,平移
摘要:RotateTransform:旋转ScaleTransform:缩放TranslateTransform:平移旋转 <Button Content="button"> <Button.Background> <SolidColorBrush Color="Gold"></SolidColorBrush> </Button.Background> <Button.RenderTransform> <RotateTransform Angle="95" Ce. 阅读全文
posted @ 2012-12-03 11:28 振宇爸爸 阅读(167) 评论(0) 推荐(0) 编辑
使用线性渐变写一个歌词播放效果
摘要:静态展示的页面显示 <TextBlock Text="相信光明就在远方" HorizontalAlignment="Left" Margin="200,200,0,0" FontSize="60"> <TextBlock.Foreground> <LinearGradientBrush> <GradientStop Color="Yellow"></GradientStop> <GradientStop Offset=" 阅读全文
posted @ 2012-12-03 09:52 振宇爸爸 阅读(177) 评论(0) 推荐(0) 编辑
用画刷为按钮配置背景颜色
摘要:单色画刷<Button Content="button"> <Button.Background> <SolidColorBrush Color="Gold"></SolidColorBrush> </Button.Background> </Button>线性渐变画刷 <Button Content="button2" Margin="50"> <Button.Background> <LinearGradien 阅读全文
posted @ 2012-12-03 09:34 振宇爸爸 阅读(154) 评论(0) 推荐(0) 编辑
图片下载
摘要:private async void Button_Click(object sender, RoutedEventArgs e) { //在这里触发下载事件 //List<ServiceReference1.Pic> jokes = await this.getFileContentAsync(); //imagepoll.Orientation = Orientation.Vertical; //imagepoll.Width = 800; //foreach (Se... 阅读全文
posted @ 2012-11-28 09:57 振宇爸爸 阅读(184) 评论(0) 推荐(0) 编辑
metro 文本文件操作
摘要:private async void Mource_Move(object sender, RoutedEventArgs e) { StackPanel panel = (StackPanel)sender; TextBlock block = (TextBlock)panel.Children[1]; string message = block.Text; var root = Windows.Storage.ApplicationData.Current.LocalFolder; ... 阅读全文
posted @ 2012-11-28 08:51 振宇爸爸 阅读(184) 评论(0) 推荐(0) 编辑
在StackPanel中加入新的stackpanel,包含图片和文字
摘要:private async void Button_Click(object sender, RoutedEventArgs e) { List<ServiceReference1.Pic> jokes = await this.getFileContentAsync(); imagepoll.Orientation = Orientation.Vertical; imagepoll.Width = 800; foreach (ServiceReference1.Pic pic in joke... 阅读全文
posted @ 2012-11-28 08:12 振宇爸爸 阅读(389) 评论(0) 推荐(0) 编辑
METRO动态创建控件
摘要:private async void Button_Click(object sender, RoutedEventArgs e) { List<ServiceReference1.Pic> jokes = await this.getFileContentAsync(); ListView view = new ListView(); int i = 0; foreach (ServiceReference1.Pic pic in jokes) { ... 阅读全文
posted @ 2012-11-27 22:33 振宇爸爸 阅读(170) 评论(0) 推荐(0) 编辑
metro中访问WCF并加载一个图片
摘要:private async void Button_Click(object sender, RoutedEventArgs e) { List<ServiceReference1.Pic> jokes = await this.getFileContentAsync(); ImageBrush imageBrush = new ImageBrush(); imageBrush.ImageSource = new BitmapImage(new Uri(jokes[4].URL)); ... 阅读全文
posted @ 2012-11-27 15:32 振宇爸爸 阅读(164) 评论(0) 推荐(0) 编辑
metro 访问WCF
摘要:METRO访问WCF的方式很简单,就和访问Webservice是一样的在项目中添加WCF的引用,在address中填写所请求的地址,点击GO,OK(如果你引用的地址没有错误的话,引用就已经完成了),然后代码中间就可以直接调用了 ServiceReference1.JokeClient client = new ServiceReference1.JokeClient(); var query = client.GetJokeListAsync(10); List<ServiceReference1.Joke> jokes = query.Result.ToList(); Messa 阅读全文
posted @ 2012-11-27 10:18 振宇爸爸 阅读(298) 评论(0) 推荐(0) 编辑
win8 应用商店程序使用SQLITE数据库
摘要:研究WIN8的应用程序商店也有几天了,苦于一直没有找到快速入门的方法,一直纠结于应该先学那一块。今天我终于想通了,想想以前在学习WEB开发的时候,也不是样样学会以后再去做的开发,说到底还是要做到哪,学到哪。今天我先说说应用商店程序使用SQLLITE。翻看MSDN,我发现微软没有提供任何使用SQLITE的示列代码,也没有提供一些API接口。后来在网上百度了一番,终于知道原来WIN8不是原生支持SQLITE的,需要安装一些插件才能使用。参考1.创建一个metro项目2.在工具,选择扩展与更新中,选择联机(online),在搜索框内输入sqlite3.将会发现一个叫做sqliteforwindowr 阅读全文
posted @ 2012-11-27 09:20 振宇爸爸 阅读(1444) 评论(0) 推荐(0) 编辑
定义页面全局变量
摘要:在mainpage.XAML中定义和使用定义方法 <Page.Resources> <!-- TODO: Delete this line if the key AppName is declared in App.xaml --> <x:String x:Key="AppName">HelloWorld</x:String> </Page.Resources>使用方法 <TextBlock x:Name="pageTitle" Grid.Column="1" Text 阅读全文
posted @ 2012-11-26 13:59 振宇爸爸 编辑

1
点击右上角即可分享
微信分享提示