MonoMobile.Views.DialogViewController.ResetTheme C# (CSharp) Method

ResetTheme() public method

public ResetTheme ( Theme newTheme ) : void
newTheme Theme
return void
		public void ResetTheme(Theme newTheme)
		{
			this.Theme.MergeTheme(newTheme);

			var source = TableView.Source as BaseDialogViewSource;

			foreach(var cell in TableView.VisibleCells)
			{
				var listCell = cell as ComposableViewListCell;
				if (listCell != null)
				{
					listCell.Theme.MergeTheme(newTheme);
				}
			}

			foreach (var section in source.Sections.Values)
			{
				foreach (var viewList in section.Views.Values)
				{
					foreach (var view in viewList)
					{
						var themeable = view as IThemeable;
						if (themeable != null)
						{
							themeable.Theme.MergeTheme(Theme);	
						}
					}
				}
			}

			ReloadData();
		}