zhxilin大神说[http://www.cnblogs.com/zhxilin/p/4819372.html](http://www.cnblogs.com/zhxilin/p/4819372.html)这文章说到了使用`await Windows.System.Launcher.LaunchUriAsync(new Uri(uri));`
打开应用商店
我想到了装机必备的一个软件
大概界面
![这里写图片描述](https://box.kancloud.cn/2016-04-08_5707636a9823d.jpg "")
求轻喷
我设计了MainPage.xaml拥有两个Frame
单例model
从[https://www.microsoft.com/zh-cn/store/top-free/apps/pc](https://www.microsoft.com/zh-cn/store/top-free/apps/pc)得到软件图片
![这里写图片描述](https://box.kancloud.cn/2016-04-08_5707636ab3513.jpg "")
Button可以设置Content为Grid
~~~
<Button.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Image Source="ms-appx:///Assets/QQ.png" Grid.Row="0" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
<TextBlock Text="搜狐视频" Grid.Row="1" HorizontalAlignment="Center" />
</Grid>
</Button.Content>
</Button>
~~~
button设置大小和图片一样,就可以把图片填到button作为按钮
右击获得应用软件QQ的ProductId,
ProductId是点击链接最后的
![这里写图片描述](https://box.kancloud.cn/2016-04-08_5707636ac55f2.jpg "")
9wzdncrfj1ps
使用
~~~
string uri = "ms-windows-store://pdp/?ProductId=9wzdncrfj1ps";
await Windows.System.Launcher.LaunchUriAsync(new Uri(uri));
~~~
在按钮写`<Button Click="QQ_Click" Width="50" Height="50" Margin="10,10,10,10" Padding="0"/>`
就可以点击跳转应用商店
![这里写图片描述](https://box.kancloud.cn/2016-04-08_5707636ad9d40.jpg "")
在页面跳转到QQ页面`chatcommunicationframe.Navigate(typeof(chatcommunication));`
因为
~~~
string uri = "ms-windows-store://pdp/?ProductId=9wzdncrfj1ps";
await Windows.System.Launcher.LaunchUriAsync(new Uri(uri));
~~~
在每次打开应用都使用,放在model
~~~
public async void windowsapp(string ProductId)
{
string uri = $"ms-windows-store://pdp/?ProductId={ProductId}";
await Windows.System.Launcher.LaunchUriAsync(new Uri(uri));
}
~~~
可以使用
~~~
private void souhu_Click(object sender , RoutedEventArgs e)
{
string ProductId = "9wzdncrfhvq0";
_model.windowsapp(ProductId);
}
~~~
view:
chatcommunication.xaml
movie.xaml
model.cs
MainPage.xaml
~~~
<Page
x:Class="classifyapp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:classifyapp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Frame Name="chatcommunicationframe" Grid.Row="0" Margin="10,10,10,10"/>
<Frame Name="movieframe" Grid.Row="1" Margin="10,10,10,10"/>
</Grid>
</Page>
~~~
chatcommunication.xaml:
~~~
<Page
x:Class="classifyapp.view.chatcommunication"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:classifyapp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Border>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF6369EB" Offset="0"/>
<GradientStop Color="#FFFAFBFF" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="聊天" Grid.Row="0" Margin="10,10,10,10"/>
<Grid Grid.Row="1">
<GridView >
<Button Click="QQ_Click" Width="50" Height="50" Margin="10,10,10,10" Padding="0">
<Button.Content>
<Image Source="ms-appx:///Assets/QQ.png" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
</Button.Content>
</Button>
</GridView>
</Grid>
</Grid>
</Border>
</Grid>
</Page>
~~~
movie.xaml
~~~
<Page
x:Class="classifyapp.view.movie"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:classifyapp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Border>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF6369EB" Offset="0"/>
<GradientStop Color="#FFFAFBFF" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="视频" Grid.Row="0" Margin="10,10,10,10"/>
<Grid Grid.Row="1">
<GridView >
<Button Click="souhu_Click" Width="50" Height="50" Margin="10,10,10,10" Padding="0" >
<Button.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Image Source="ms-appx:///Assets/搜狐.png" Grid.Row="0" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
<TextBlock Text="搜狐视频" Grid.Row="1" HorizontalAlignment="Center" />
</Grid>
</Button.Content>
</Button>
<Button Click="blibli_Click" Width="50" Height="50" Margin="10,10,10,10" Padding="0">
<Button.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Image Source="ms-appx:///Assets/blibli.png" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
<TextBlock Text="搜狐视频" Grid.Row="1" HorizontalAlignment="Center" />
</Grid>
</Button.Content>
</Button>
<Button Click="manguo_Click" Width="50" Height="50" Margin="10,10,10,10" Padding="0">
<Button.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Image Source="ms-appx:///Assets/芒果.png" Width="50" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
<TextBlock Text="芒果TV" Grid.Row="1" HorizontalAlignment="Center" />
</Grid>
</Button.Content>
</Button>
<Button Click="youku_Click" Width="50" Height="50" Margin="10,10,10,10" Padding="0">
<Button.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Image Source="ms-appx:///Assets/优酷.png" Width="50" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
<TextBlock Text="优酷TV" Grid.Row="1" HorizontalAlignment="Center" />
</Grid>
</Button.Content>
</Button>
<Button Click="baofengyingyin_Click" Width="50" Height="50" Margin="10,10,10,10" Padding="0">
<Button.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Image Source="ms-appx:///Assets/暴风影音.png" Width="50" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
<TextBlock Text="暴风影音" Grid.Row="1" HorizontalAlignment="Center" />
</Grid>
</Button.Content>
</Button>
</GridView>
</Grid>
</Grid>
</Border>
</Grid>
</Page>
~~~
没有使用比较多的东西,简单单例,按钮,frame,GridView,没有使用bind,动画
margin可以使用”10”,我都是使用”10,10,10,10”,虽然好多写法可以简单,让代码变少,也不会容易出错,但是没有那么多,只是做一个看到的想到的好的东西,虽然这个应该发布是不会的,但是也有一些想不开的也许就发出来,有人想要。不过这样只是在博客可以这样说,实际的软件这样开发,根本做不到,因为没有那么多人都知道我的想法,知道了也不会开发出来,除了技术还有的是做出来是他想的。
也没有那些跳转出来的,好看的,我设计看起来没有一点好,本来想做一个好看的天蓝,最后成了上面的那个
![这里写图片描述](https://box.kancloud.cn/2016-04-08_5707636b56df7.jpg "")
需要的技术很少
做出来可以是一个装机必备,不知有谁想到这么简单技术做出的,可以卖软件,不知道有谁要,挂个价格100
代码:[https://code.csdn.net/lindexi_gd/lindexi_gd/tree/master/classifyapp](https://code.csdn.net/lindexi_gd/lindexi_gd/tree/master/classifyapp)
参考:[https://msdn.microsoft.com/en-us/library/windows/apps/mt228343.aspx](https://msdn.microsoft.com/en-us/library/windows/apps/mt228343.aspx)
- 前言
- UWP win10 app 新关键字x:Bing
- win10应用 UWP 使用MD5算法
- win10 UWP读写文件
- UWP appButtonBar样式
- C# 6.0 $&quot;Hello {csdn}&quot;
- Win10 UWP xaml 延迟加载元素
- UWP xaml 圆形头像
- UWP 绘制图形
- win10 uwp 通知Toast
- win10 UWP 显示地图
- win10 uwp 参考
- win10 uwp clone
- win10 uwp 装机必备应用 含源代码
- RichEditBox 使用自定义菜单
- win10 UWP FlipView
- win10 UWP 获取系统信息
- win10 UWP 申请微软开发者
- win10 UWP button
- win10 UWP Markdown 含源代码
- win10 UWP 应用设置
- win10 UWP 九幽数据分析
- win10 UWP 圆形等待
- win10 UWP 标题栏后退
- win10 UWP 单元测试
- win10 UWP 你写我读
- win10 UWP RSS阅读器
- win10 UWP MessageDialog 和 ContentDialog
- win10 UWP Hmac
- win10 UWP GET Post
- Win10 UWP Intro to controls and events
- win10 UWP Controls by function
- win10 uwp App-to-app communication 应用通信