Bug 31664 - On MasterDetailPage trying to change Icon or Title of Master page doesn't works, need to open and close the menu
Summary: On MasterDetailPage trying to change Icon or Title of Master page doesn't wor...
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.3
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Rui Marinho
URL:
Depends on:
Blocks:
 
Reported: 2015-07-06 10:46 UTC by Davide
Modified: 2015-08-07 11:08 UTC (History)
6 users (show)

Tags: AC
Is this bug a regression?: ---
Last known good build:


Attachments
Example of code replicating the error (164.75 KB, application/zip)
2015-07-07 09:14 UTC, Davide
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Davide 2015-07-06 10:46:45 UTC
I'm trying to change the Icon or the Title property of the master detail page whenever the user has some communication to read. When I change the Icon or the Title the code run smoothly, but to have the changes rendered in the view I need to open and then Close the Menu.. Here is the code that I'm using... 
Firstly the menuView, AKA the master page for the master detail page

 public class MenuView : ContentPage
    {
        public Action<MenuItem> MenuItemSelected;
	private MenuViewModel _viewModel;
        public MenuView()
        {
            NotificationsHandler.UpdateAppIconBadge ();
	    Title = "Notifications"+"("+ AppContext.NotificationNumber+")";
            _viewModel = new MenuViewModel (this)
            BindingContext = _viewModel;
            var header = SetupHeader();
            var menuItems = SetupMenuItems();
            var listView = SetupMenuList(menuItems);

            Content = new StackLayout {
                Spacing = 1,
                Children = {
                    header,
                    listView
                }
            };
        }
}

And here is the ViewModel for it:
public class MenuViewModel : ViewModel
	{
		MenuView _view;
		public MenuViewModel (MenuView view)
		{
			_view = view;
			_view.Title = "Notifiche"+"("+ AppContext.NotificationNumber+")";
			MessagingCenter.Subscribe<CommunicationHelper> (this, Messages.NotificationNumber, (sender) => {
				_view.Title = "Notifiche"+"("+ AppContext.NotificationNumber+")";
			});
		}
        }
As you can see I'm using the MessagingCenter to trigger the event... In my case the event is triggered whenever I receive a RemoteNotification
As I said the problem is that the Title (the result is the same if I try to change the Icon) does not change when I change the property.. But only after I open and close the menu. Even using the Binding the result is the same.
Comment 1 Parmendra Kumar 2015-07-07 07:03:20 UTC
@Davide

I have tried to reproduce this issue but not able to reproduce this issue.
Could you please provide us a sample project? so that I can reproduce this issue at my end efficiently.

Thanks.
Comment 2 Davide 2015-07-07 09:14:10 UTC
Created attachment 11905 [details]
Example of code replicating the error

The error is not replicable on emulator.. Only on device..
Comment 3 Davide 2015-07-08 03:27:57 UTC
@Parmendra Just to be clear, the code that I provided does not work in any ambient, device or emulator but both have different behaviour. In the emulator the Icon is not changed at all, never. Meanwhile in a device the Icon changes when opening or closing the Menu.
Comment 4 Parmendra Kumar 2015-07-08 12:02:43 UTC
@Davide

I have checked this issue with attached sample project in comment #2 and I am getting blank screen on both emulator and device.

Screencast: http://www.screencast.com/t/zOD2g1diA6g

Please check the screencast and let me know if I have missed anything.

Thanks.
Comment 5 Davide 2015-07-08 12:31:04 UTC
@Parmendra The behaviour that I want:
the icon on top left (the 3 gray bar ) after clicking on the button should become the image NotificationBadge.png. But this does not happen. 
What happens instead for iOS:
In iOS in the device if you click the button change icon nothing will happen, but if you open then close the menu the icon will change becoming the NotificationBadge.png. 

On Android nothing at all happens.
Comment 6 Davide 2015-07-13 03:54:01 UTC
Any news?
Comment 7 Parmendra Kumar 2015-07-13 06:46:05 UTC
Thanks @Davide

I have rechecked this issue and observed that  after clicking on the button should not become the image NotificationBadge.png.

Hence confirm this issue.

IDE Log: https://gist.github.com/Parmendrak/3d3ab5ac8b7f789ae7fe

Environment info:
Xamarin.Forms: 1.4.3.6376
Xamarin Studio5.9.4 (build 5)
Mono 4.0.2 ((detached/c99aa0c)
GTK+ 2.24.23 (Raleigh theme)
Xcode 6.2 (6776)
Xamarin.iOS: 8.10.3.2 (Enterprise Edition)
Xamarin.Android: 5.1.4.16 (Enterprise Edition)
Mac OS X 10.9.4
Comment 8 Parmendra Kumar 2015-07-13 06:50:56 UTC
Please ignore comment #7

Thanks @Davide

I have checked this issue and observed that  after clicking on the button it doesn't changed to image NotificationBadge.png.

Hence confirm this issue.

IDE Log: https://gist.github.com/Parmendrak/3d3ab5ac8b7f789ae7fe

Environment info:
Xamarin.Forms: 1.4.3.6376
Xamarin Studio5.9.4 (build 5)
Mono 4.0.2 ((detached/c99aa0c)
GTK+ 2.24.23 (Raleigh theme)
Xcode 6.2 (6776)
Xamarin.iOS: 8.10.3.2 (Enterprise Edition)
Xamarin.Android: 5.1.4.16 (Enterprise Edition)
Mac OS X 10.9.4
Comment 9 Jason Smith [MSFT] 2015-08-05 15:04:49 UTC
Should be fixed in 1.5.0-pre1
Comment 10 Parmendra Kumar 2015-08-06 14:37:03 UTC
I have checked this issue with Xamarin.Forms 1.5.0-pre1 and its working fine at my end. 


Hence closing this issue.
Comment 11 Davide 2015-08-07 09:50:48 UTC
Yeah one thing, why the image is blue? Can't it be of the native color?
Comment 12 Davide 2015-08-07 10:34:27 UTC
Also there is a little problem in how it is solved, it doesn't work in my solution... I reproduced the error case, do you read me here and I can post it here or do I need to open a new bug?
Comment 13 Parmendra Kumar 2015-08-07 10:52:54 UTC
@Davide: The reported issue has been FIXED.

Please file a new bug for the behavior you mentioned in comment #11 and comment #12.


Thanks.
Comment 14 Rui Marinho 2015-08-07 11:08:20 UTC
@Davide is blue in iOS? That's the default tint color, you can change it by setting  BarTextColor on your NavigationPage