在我的电子商务应用程序中,我需要在Bing地图中绘制我附近的商店,而我的另一个要求是在缩放和调整地图时我需要根据地图中心更新我的商店.因此,为了实现这一点,我主要选择传统的编码方式.步骤如下.
首次启动我将发送api请求位置,并将在地图上绘制商店.
在Google搜索期间,我发现了许多关于使用Microsoft Rx框架实现类似功能的建议.但没有得到任何正确的代码示例来实现我的目标.任何人都可以帮助我或指导我解决我的问题.请记住,我需要在一次请求中在地图上平均绘制400个商店.
问候,
Stez.
我正在使用CameraCaptureUI在我的应用程序中打开相机; 这是我使用的代码
var camera = new CameraCaptureUI();
camera.PhotoSettings.AllowCropping = false;
var file = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (file != null)
{
var fileStream = await file.OpenAsync(FileAccessMode.Read);
var bitmapImage = new BitmapImage();
bitmapImage.SetSource(fileStream);
var sourceImage = new WriteableBitmap(bitmapImage.PixelWidth, bitmapImage.PixelHeight);
var imageStream = await file.OpenAsync(FileAccessMode.Read);
sourceImage.SetSource(imageStream);
}
Run Code Online (Sandbox Code Playgroud)
但问题不在于相机.在相机打开期间.如果我们打开设置魅力,则await函数取消 var file = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo);[File returns null]并隐藏CameraCapture UI.我想要做的是即使用户打开魅力,我也需要一直打开相机.我如何在WinRT中实现这一目标
这是我用于在XAML中绑定图像的代码
<Border toolkit:TiltEffect.IsTiltEnabled="true" Height="350" Width="400" Grid.ColumnSpan="3">
<Grid Height="350" Width="400" Margin="70,0,70,0" x:Name="Container1">
<Grid.Background>
<ImageBrush ImageSource="{Binding ImageCollection[0]}" Stretch="Uniform" AlignmentX="Left" AlignmentY="Center"/>
</Grid.Background>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Tap">
<i:InvokeCommandAction Command="{Binding ImageTapCommand}" CommandParameter="CONTAINER0"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Grid>
</Border>
Run Code Online (Sandbox Code Playgroud)
同样我使用4边框显示我最近的图像.
在我的ViewModel中,我使用以下方法从隔离存储中读取图像.
public Stream GetFileStream(string filename, ImageLocation location)
{
try
{
lock (SyncLock)
{
if (location == ImageLocation.RecentImage)
{
filename = Constants.IsoRecentImage + @"\" + filename;
}
using (var iSf = IsolatedStorageFile.GetUserStoreForApplication())
{
if (!iSf.FileExists(filename)) return null;
var fs = iSf.OpenFile(filename, FileMode.Open, FileAccess.Read);
return fs;
}
}
}
catch (Exception …Run Code Online (Sandbox Code Playgroud) 
以上是我正在使用的图像.我想要实现的是从图像中删除边框的红色部分.如何在Windows Phone中以编程方式实现此目的?我找到了WriteableBitmapExtensions.Crop()方法,但我对参数感到困惑(如何找到图像的x,y位置,以及大小和宽度?)
我面临的另一个问题是:我将获得具有不同大小边框的图像,因此我无法对x或y值进行硬编码.
任何人都可以建议解决方案,或指导我解决问题?
请任何人告诉我SelectManyRx中的操作员如何工作.我也不知道Linq中有关此运算符的更多信息.
请在一个简单示例的帮助下解释这一点,以及在什么情况下我们将在Rx中使用此运算符.
我是否需要在Windows Phone 8中使用性能进度条.在我的Windows Phone 7/7.5应用程序中,我使用了工具包附带的进度条(性能进度条).是否有必要在Windows Phone 8中使用相同或简单的进度条就足够了?
这是我正在使用的xaml代码
<GridView
Grid.Row="0"
x:Name="RootGrid"
SelectionMode="None"
IsItemClickEnabled="True"
ItemsSource="{Binding RootListSource}">
<GridView.ItemTemplate>
<DataTemplate>
<UserControl:TreeInfoControl/>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
Run Code Online (Sandbox Code Playgroud)
在我的用户控件中,它包含另一个包含不同IEnumerable集合的GridView.我想要实现的是我需要通过代码传递这个集合.我通过向treecontrol添加依赖属性来尝试此操作,但它无法正常工作.所以我正在寻找一种解决方案,允许通过xaml传递集合(以某种方式通过用户控件).我知道可以将该集合添加到我现有的集合中并绑定该集合.但是现在我不能使用那种方法.
xaml windows-8 windows-runtime winrt-xaml windows-store-apps
在我的应用程序中,我在My API调用期间收到包含4个pdf文档的ZIP文件.我正在使用以下代码保存ZIP文件.
var rootFolder = FileSystem.Current.LocalStorage;
var file = await rootFolder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting);
using (var fileHandler = await file.OpenAsync(FileAccess.ReadAndWrite))
{
await fileHandler.WriteAsync(document, 0, document.Length);
}
Run Code Online (Sandbox Code Playgroud)
保存文档后,
我如何解压缩并单独将pdf文档保存到手机内存中.任何人都可以指示我解决这个问题.我找到了SharpZipLib和Iconic zip库来解压缩代码; 但是如果在文档中找到了dot net实现,则不知道如何在Xamarin Forms中集成它.
请帮忙.
从这篇文章我开始知道存在一些平台改进来实现捏合和缩放功能.通过使用这个新方法(ManipulationDeltaEventArgs.PinchManipulation)我如何在Windows Phone中实现捏缩放功能.
除此之外,我还需要为图像控件实现滚动功能.在我目前的实现中,我使用Toolkit(手势监听器)进行捏合和缩放功能以及滚动查看器,现在看起来既滚动又捏合事件重叠,因此会产生糟糕的用户体验.
任何人都可以帮助我在我的应用程序中解决这个问题.我正在寻找一些帮助我实现功能的代码示例.
我不希望得到Multi touch行为(codeplex)作为答案.在项目中使用的组件已经很老了,我听说他们中的许多人因此而面临市场提交的问题.
silverlight-4.0 windows-phone-7 windows-phone-7.1 windows-phone-8
我正在使用以下代码在我的 StackPanel Childran 中执行拖放操作,
XAML
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="601" Width="637">
<StackPanel Name="sp" AllowDrop="True" Background="SkyBlue" PreviewMouseLeftButtonDown="sp_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="sp_PreviewMouseLeftButtonUp" PreviewMouseMove="sp_PreviewMouseMove"
DragEnter="sp_DragEnter" Drop="sp_Drop">
<Image Source="/Assets/Image1.jpg" Height="100" Width ="100"/>
<Image Source="/Assets/Image2.jpg" Height="100" Width ="100"/>
<Image Source="/Assets/Image3.jpg" Height="100" Width ="100"/>
<Image Source="/Assets/Image4.jpg" Height="100" Width ="100"/>
<Image Source="/Assets/Image5.jpg" Height="100" Width ="100"/>
</StackPanel>
Run Code Online (Sandbox Code Playgroud)
代码隐藏
Run Code Online (Sandbox Code Playgroud)public partial class Window1 : Window { public Window1() { InitializeComponent(); } private bool _isDown; private bool _isDragging; private Point _startPoint; private UIElement _realDragSource; private UIElement _dummyDragSource = new UIElement();
private void …Run Code Online (Sandbox Code Playgroud) windows-8 ×3
c# ×2
winrt-xaml ×2
.net ×1
bing ×1
dotnetzip ×1
image ×1
sharpziplib ×1
wpf ×1
wpf-controls ×1
xamarin ×1
xaml ×1