i wanna provide share option from my windows app to another apps in my windows phone, like android develpement. please any one tell, is it possible in windows phone. (using RT, not in silver Light) Thank You in advance.
For example: like the below image
I am using below code using "How to use ShareLinkTask namespace in Windows Phone 8.1?" link.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
DataTransferManager dtManager = DataTransferManager.GetForCurrentView();
dtManager.DataRequested += dtManager_DataRequested;
}
private async void dtManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
e.Request.Data.Properties.Title = "Code Samples";
e.Request.Data.Properties.Description = "Here are some great code samples for Windows Phone.";
e.Request.Data.SetWebLink(new Uri("http://code.msdn.com/wpapps"));
}
// Click Button to share Web Link
private void btnShareLink_Click(object sender, RoutedEventArgs e)
{
Windows.ApplicationModel.DataTransfer.DataTransferManager.ShowShareUI();
}
but it displays a progress bar with a message Preparing content to share and then it disappears, with no UI for sharing.
what should I do.please help me.
Related
I have an universal app and the windows version use ink manager to capture a signature. I want to do the same with the phone but the ink manager dont exist. Does anyone have or know an alternative.
I added a canvas named Display and add this code using two events.
private Point _currentPoint;
private Point _oldPoint;
private async void Display_PointerMoved(object sender, PointerRoutedEventArgs e)
{
DrawPoint(e);
}
private void DrawPoint(PointerRoutedEventArgs e)
{
_currentPoint = e.GetCurrentPoint(this).Position;
Line linea = new Line
{
Stroke = new SolidColorBrush(Colors.Black),
StrokeThickness=1,
X1 = _currentPoint.X,
Y1 = _currentPoint.Y,
X2 = _oldPoint.X,
Y2 = _oldPoint.Y
};
Display.Children.Add(linea);
_oldPoint = _currentPoint;
}
private void Display_PointerPressed(object sender, PointerRoutedEventArgs e)
{
_currentPoint = e.GetCurrentPoint(this).Position;
_oldPoint = _currentPoint;
}
Input: XAML user input events sample in Microsoft MSDN code has a sample using pointer events with both C# and Visual Basic. Specifies Visual Studio 2013 but will probably upgrade with a later version of Visual Studio. And this example looks to be for Windows 8.1 however you might be able to use that as a starting place.
I have to develop an app for Windows Phone 8. I want the user to be briefly notified without force him to face a Message Box (and consequently having to press a button to dismiss it). Are there any alternatives? I'm from Android and something similar to a Toast would be perfect. Also having the opportunity to change the text color would be nice.
Thank you in advance.
There are toasts in Windows Phone as well but AFAIR they can be used only when your app is in the background. But there is a solution: ToastPrompt class from Coding4Fun toolkit which is visually equal to toast notification.
See details:
https://stackoverflow.com/a/13981508/1985167
You can use ToastPrompt from Coding4Fun toolkit,
like this,
private void ToastWrapWithImgAndTitleClick(object sender, RoutedEventArgs e)
{
var toast = GetToastWithImgAndTitle();
toast.TextWrapping = TextWrapping.Wrap;
toast.Show();
}
private static ToastPrompt GetToastWithImgAndTitle()
{
return new ToastPrompt
{
Title = "With Image",
TextOrientation = System.Windows.Controls.Orientation.Vertical,
Message = LongText,
ImageSource = new BitmapImage(new Uri("../../ApplicationIcon.png", UriKind.RelativeOrAbsolute))
};
}
I'm working on a windows phone 8 application. I want to use toggle switch for some purposes. Sadly windows phone 8 does not have that controller. So i had to install windows phone toolkit nuget package.
Now I want to set the state(some thing like isChecked=true). but I couldn't find any method to use.
can someone please help me.
Try this on Button Click
private void Button_Click(object sender, RoutedEventArgs e)
{
if (toggleSwitch.IsChecked == true)
toggleSwitch.IsChecked = false;
else
toggleSwitch.IsChecked = true;
}
It is Working....
I am developing windows phone application. I am retrieving event images from Facebook.
Problem:
how to take detail information about the event like date place of image by clicking on that image
If you are using listbox then
private void YourList_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{
FaceBookClass fbc = YourEventList.SelectedItem as FaceBookClass ;
String date=fbc.Date;
String place=fbc.Place;
}
I have the simplest possible app. The UI is a page with nothing on it but a Tap method on a grid.
The code-behind looks like this...
public partial class MainPage : PhoneApplicationPage
{
private PhotoChooserTask _photoChooser;
// Constructor
public MainPage()
{
InitializeComponent();
_photoChooser.Completed += OnPhotoChosen;
}
private void OnTap(object sender, System.Windows.Input.GestureEventArgs e)
{
_photoChooser.Show();
}
private void OnPhotoChosen(object sender, PhotoResult result)
{
}
}
Now, what happens is that when I debug this application ON THE DEVICE, it briefly shows the photo chooser but then immediately deactivates...I assume because the photo chooser has taken focus. But from everything I've read, this should NOT be happening because the PhotoChooserTask's Completed event has been wired up in the constructor for my page, which should explicitly prevent my app from deactivating when the photochooser is active.
What's even more confusing is that the app seems to work when I'm NOT debugging it. Once I've selected a photo in this scenario, my app regains the foreground.
Is this a bug with the debugger or something else?
So it turns out the solution is to debug using "Start New Instance" in Visual Studio rather than just hitting F5.