{"action":"created","issue":{"url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2215","labels_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2215/labels{/name}","comments_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2215/comments","events_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2215/events","html_url":"https://github.com/MahApps/MahApps.Metro/issues/2215","id":117461354,"number":2215,"title":"SplitButton does not respect GroupStyle","user":{"login":"bloritsch","id":194574,"avatar_url":"https://avatars.githubusercontent.com/u/194574?v=3","gravatar_id":"","url":"https://api.github.com/users/bloritsch","html_url":"https://github.com/bloritsch","followers_url":"https://api.github.com/users/bloritsch/followers","following_url":"https://api.github.com/users/bloritsch/following{/other_user}","gists_url":"https://api.github.com/users/bloritsch/gists{/gist_id}","starred_url":"https://api.github.com/users/bloritsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bloritsch/subscriptions","organizations_url":"https://api.github.com/users/bloritsch/orgs","repos_url":"https://api.github.com/users/bloritsch/repos","events_url":"https://api.github.com/users/bloritsch/events{/privacy}","received_events_url":"https://api.github.com/users/bloritsch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-17T22:02:17Z","updated_at":"2015-11-17T22:23:05Z","closed_at":null,"body":"SplitButton extents ItemsCollection, which allows me to specify a GroupStyle (useful in configurations where I want to supply a set of standard static colors and a set of theme colors).\r\n\r\nThe \"PART_ListBox\" needs to bind the \"GroupStyle\" collection in SplitButton to the ListBox.GroupStyle collection.  The short term work around was to subclass the SplitButton and override the OnApplyTemplate() call.\r\n\r\n    public override void OnApplyTemplate()\r\n    {\r\n        base.OnApplyTemplate();\r\n\r\n        // Can't use the EnforceType<ListBox> method in the base class because it's private.\r\n        ListBox listBox = GetTemplateChild(\"PART_ListBox\") as ListBox;\r\n\r\n        if(listBox == null) { return; }\r\n\r\n        foreach(GroupStyle style in GroupStyle)\r\n        {\r\n            listBox.GroupStyle.Add(style);\r\n        }\r\n    }"},"comment":{"url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/comments/157529364","html_url":"https://github.com/MahApps/MahApps.Metro/issues/2215#issuecomment-157529364","issue_url":"https://api.github.com/repos/MahApps/MahApps.Metro/issues/2215","id":157529364,"user":{"login":"bloritsch","id":194574,"avatar_url":"https://avatars.githubusercontent.com/u/194574?v=3","gravatar_id":"","url":"https://api.github.com/users/bloritsch","html_url":"https://github.com/bloritsch","followers_url":"https://api.github.com/users/bloritsch/followers","following_url":"https://api.github.com/users/bloritsch/following{/other_user}","gists_url":"https://api.github.com/users/bloritsch/gists{/gist_id}","starred_url":"https://api.github.com/users/bloritsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bloritsch/subscriptions","organizations_url":"https://api.github.com/users/bloritsch/orgs","repos_url":"https://api.github.com/users/bloritsch/repos","events_url":"https://api.github.com/users/bloritsch/events{/privacy}","received_events_url":"https://api.github.com/users/bloritsch/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T22:23:05Z","updated_at":"2015-11-17T22:23:05Z","body":"Addendum, I also had to bind the ItemsPanel property:\r\n\r\n    BindingOperations.SetBinding(listBox, ItemsPanelProperty, new Binding\r\n    {\r\n        Source = this,\r\n        Path = new PropertyPath(ItemsPanelProperty)\r\n    });"}}