Make clickable UI-elements for windows Phone 8.1 apps maps - xaml

Windows Phone 8.1 App , C#
I would like to let the user add Pushpins ( which apparently are called MapIcons ) to the map and when the user clicks the newly created Pushpin some other ui-elements should appear.
But apparently MapIcons are not clickable and you can not inherit from them since they are sealed, so no luck in making them clickable.
I tried to just extend from Windows.UI.Xaml.Controls.Button , but those have not Location, probably because they do not belong to the Windows.UI.Xaml.Controls.Maps-namespace. So I can not really add them to the Windows.UI.Xaml.Controls.Maps.MapControl.Children or Windows.UI.Xaml.Controls.Maps.MapControl.MapElements, since they will not be on the map where I would want them to be.
So how do you make a clickable ui-element that I can give a location on the map?

You can throw pretty much anything you want on there and just bind to the MapControl.Location attached property for the object placement as long as they're children of a map parent.
See more detail explanation here in the docs.

Related

Google pay pass Event Ticket CardTemplateOverride- Unable to hide TextModuleData which is used as a FieldReference

I am working on creating an EventPass to be saved to google pay.
I am following this link pass template to create EventPass.
I have succesfully created the Event by Overriding and making a few changes to the layout by using CardTemplateOverride but there are two issues which I am unable to resolve.
1.In CardTemplateOverride I have used FieldReferences of TextModuleData which I had created only for the purpose of showing in CardTemplateOverride. But I do not see a way to hide the TextModuleData which is also showing up at the bottom of the cards.
Could someone suggest a way to hide this textModuleData?
2.In CardTemplateOverride I have used CardRowOneItem, But it is center aligned as mentioned in the document. But my requirement is to have it left aligned and I do not see any option that allows me to do so.
From what I learnt so far the documentation, I do not see a way to do it. But I am not sure.
I have attached an Image Google Pay Event Pass that has been created. The canvas area in the center is a barcode which I have removed just for security concerns.
In the card area we have Date and Time which is referenced from the TextModuleData below the card. But I do not want to show the same information twice. Also the EntryInfo is center Aligned which I could not override and align it to the left.

Xamarin - How to view rendered Xaml

Our team is working on an effort to improve the accessibility of our mobile application developed with Xamarin. One area we're having trouble tackling is Focus Path (i.e. tab order). Research examples suggest that the focus path should naturally be top down if the layout is created correctly. However, the examples are often simple and not real-world with respect to complex layouts and navigation (or whatever Marketing dreams up). We have several re-usable 'controls' and templates the get injected as part of the layout like main navigation, search, etc. The focus path, or tab order, is all over the place.
Tools that offer live preview/xaml edit only work against the opened xaml file which in many of our cases is just part of the overall xaml that makes up the screen.
Looking for a way to view 'rendered xaml' that makes a up a given screen in a xamarin mobile app. We need to see the final xaml that includes all of the dynamic controls, templates, etc. that get mashed together. This may help us understand what's happening to our focus path.
EDIT: we've found that forcing/setting tabindex does not help.
Is there such a tool or process?
I was using https://www.livexaml.com/ for such a purpose.

How do I add/remove density colors on the Windows Universal App CalendarView control after loading?

CalendarViewDayItemChanging seems to be the way to add 'density colors' (coloured bars in a DayItem box) to a Windows Universal App CalendarView.
However CalendarViewDayItemChanging is only fired when the DayItem box is loaded i.e. on initial loading and possibly when navigating to a far enough date and back again such that the virtualisation re-loads the DayItem.
However when I create an appointment on the selected date I need to add a density color bar immediately, similarly if I remove an appointment, I need to remove that bar.
How do I get the control to reload or re-render that particular DayItem?
Notes:
There is only the SelectedDates available as a property
There is no obvious way to ge the DayItem collection
Setting the Visibility to Collapsed then Visible instantaneously does not trigger a reload.
There was a similar issue on the MSDN blogs here: https://social.msdn.microsoft.com/Forums/en-US/54c81ada-4147-474b-8425-524ec69bc749/uwp-calendarview?forum=wpdevelop
I think your best bet currently is to have your Appointment creation on a separate page and store a List of Appointments locally or in a db. That way when you navigate back to the Page with your calendar view you can reload the Calendar using the updated Appointment list.
I used the MyCalendarView.UpdateLayout method to force the control to hit the CalendarViewDayItemChanging event again.
I called the method from the DataContextChanged event on my UserControl. This way anytime I change the DataContext the density colors get updated. This is sufficient for my needs. It sounds like you want to do it on a different event.
private void UserControl_DataContextChanged(Windows.UI.Xaml.FrameworkElement sender, Windows.UI.Xaml.DataContextChangedEventArgs args)
{
if (this.DataContext is ObservableCollection<Event>)
{
eventCalendar.UpdateLayout();
}
}

Create and use global view in C# WP8 XAML

I was trying to digg something on this topic before, but have no luck. What I'm trying to achieve is pretty simple, but seems to be hard to achieve :-)
I have a WP8 app (C# XAML) and I need to implement global messages (something like toasts) which could be displayed across whole application no matter of current navigation processes. Such toast message(s) should be displayed even while user is navigating between pages. To use the built in toasts is not a way (in case some other solution exists) since I'm possibly in need to have more than one message displayed at the same time (each one is independent of another) and should disappear after specified period of time.
So, my question is. Is there any way how to implement and use some kind of global view instance which sits above all pages and can be called from any page?
All I found until now is the possible ability to use PhoneApplicationFrame, but I would like rather avoid that if possible. I'm still unsure if this is even the way it can be done, but I suppose so. Do you have any alternatives or assurance this is possible and only way to achieve this goal?
Thank you all for your time and answers.
You can have UerControl for the Functionality you are looking for. It is Control that has its own Seprate Xaml and cs file. You can call it from any page into your Project. UserControl provides the base class for defining a new control that encapsulates related existing controls and provides its own logic. You have a XAML file and C# class file for a user control. The class file extends the UserControl class and adds additional behaviours and properties. The XAML file encapsulates the composing controls, the styles, the templates, animations and whatever necessary to form the UI. Since it is a just composition, it is really easy to create. for more Reference you can go here Why and how to create a User Control in Windows Phone
I have ended up rolling my own custom navigation using a single master page. As such any global controls are instantiated once at startup. Navigations are called from my viewmodels and result in usercontrols being removed and added to the visual tree as necessary (using transition animations to give the impression of page navigation) This works but im not sure whether it is best practice and would appreciate some opinions and comments on this. Certainly it solves the problem of global views described.

How to create wizard/screens with disabled pages/buttons using Dojo Dijit?

I want to create a sequence of screens using a StackContainer in Dijit.
However, I want to disable consecutive pages and their corresponding buttons in the StackController until the form on the current page has been validated successfully.
Is this possible with the standard elements? If so, how?
In addition, it would be nice if I could customize the buttons of the StackController to show my own details instead of the title of the screen.
For disabling I think you can use
the_button.set('disabled', true); //and vice-versa
For changing the details you can try setting the labels directly (similar to disabled) or try subclassing the appropriate stuff (probably the stackcontroller) if it turs out to be feasible.