简体   繁体   English

WPF的iPhone类型背景控件

[英]iPhone type Background Control for WPF

I want to create an app that is somewhat of an iPhone emulator (and by emulator I mean user control that looks like a picture of an iPhone but it's still just all .NET under the hood). 我想创建一个有点像iPhone模拟器的应用程序(通过模拟器,我的意思是用户控件看起来像iPhone的图片,但实际上仍然只是所有的.NET)。

I just want to use it to demonstrate/prototype some ideas and see how it would look on the phone and could demonstrate it's functionality to others. 我只是想用它来演示/原型化一些想法,看看它在电话上的外观,并可以向其他人演示它的功能。 Why WPF? 为什么选择WPF? Because I'm a .NET developer and I don't want to spend much time on learning something I may never use. 因为我是.NET开发人员,所以我不想花很多时间学习可能永远不会使用的东西。

Does anyone know if a control like this exists? 有人知道这样的控件是否存在吗? Or a pre-made style? 还是预制的样式?

Thanks! 谢谢!

If you just want an iphone picture and then the ability to put arbitrary controls inside of it, do something like this inside your XAML: 如果您只想要一张iphone图片,然后可以在其中放置任意控件,请在XAML中执行以下操作:

<Grid>
    <Grid.Background>
        <ImageBrush ImageSource="iphone.png" />
    </Grid.Background>
    <Frame Name="sourceFrame" Source="springboard.xaml" Margin="left,top,right,bottom" />
</Grid>

iPhone.png needs to be a picture of the iphone. iPhone.png必须是iPhone的图片。 You can find these readily available on the internet. 您可以在Internet上找到这些现成的。 Open the image in a picture editor and find the distance to the left side of the actual screen and put that in the margin for left. 在图片编辑器中打开图像,找到到实际屏幕左侧的距离,并将其放在左边距中。 Do the same for top, right, and bottom. 对顶部,右侧和底部执行相同的操作。 Then just create springboard.xaml, and you're set. 然后只需创建springboard.xaml,就可以设置好了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM