Skip to content
This repository has been archived by the owner on Sep 2, 2019. It is now read-only.

Commit

Permalink
Initial commit of 71382
Browse files Browse the repository at this point in the history
  • Loading branch information
enyim committed Feb 12, 2012
0 parents commit 24f1139
Show file tree
Hide file tree
Showing 256 changed files with 39,432 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
@@ -0,0 +1,8 @@
.svn
bin
obj
debug
release
*.suo
*.user
packages
132 changes: 132 additions & 0 deletions Microsoft.Phone.Controls.Toolkit.Design/AutoCompleteBoxMetadata.cs
@@ -0,0 +1,132 @@
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

#if WINDOWS_PHONE_DESIGN
using Controls = Microsoft.Phone.Controls;
using DesignerProperties = Microsoft.Phone.Controls.Toolkit.Design.Properties;
#else
extern alias Silverlight;
using System.Windows.Controls.Design.Common;
using Controls = Silverlight::System.Windows.Controls;
using DesignerProperties = System.Windows.Controls.Properties;
#endif

using System.ComponentModel;
using Microsoft.Windows.Design;
using Microsoft.Windows.Design.Metadata;
using Microsoft.Windows.Design.PropertyEditing;

#if WINDOWS_PHONE_DESIGN
namespace Microsoft.Phone.Controls.Design
#else
namespace System.Windows.Controls.Input.Design
#endif
{
/// <summary>
/// To register design time metadata for AutoCompleteBox.
/// </summary>
internal class AutoCompleteBoxMetadata : AttributeTableBuilder
{
/// <summary>
/// To register design time metadata for AutoCompleteBox.
/// </summary>
public AutoCompleteBoxMetadata()
: base()
{
#if WINDOWS_PHONE_DESIGN
AddCustomAttributes(typeof(AutoCompleteBox), "FilterMode", new CategoryAttribute(DesignerProperties.Resources.CommonProperties));
AddCustomAttributes(typeof(AutoCompleteBox), "InputScope", new CategoryAttribute(DesignerProperties.Resources.AutoComplete));
AddCustomAttributes(typeof(AutoCompleteBox), "InputScope", new DescriptionAttribute("Gets or sets the InputScope used by the Text template part."));
AddCustomAttributes(typeof(AutoCompleteBox), "IsDropDownOpen", new CategoryAttribute(DesignerProperties.Resources.AutoComplete));
AddCustomAttributes(typeof(AutoCompleteBox), "IsTextCompletionEnabled", new CategoryAttribute(DesignerProperties.Resources.CommonProperties));
AddCustomAttributes(typeof(AutoCompleteBox), "ItemFilter", new BrowsableAttribute(false));
AddCustomAttributes(typeof(AutoCompleteBox), "ItemsSource", new NewItemTypesAttribute(typeof(string)));
AddCustomAttributes(typeof(AutoCompleteBox), "MaxDropDownHeight", new CategoryAttribute(DesignerProperties.Resources.AutoComplete));
AddCustomAttributes(typeof(AutoCompleteBox), "MinimumPopulateDelay", new CategoryAttribute(DesignerProperties.Resources.AutoComplete));
AddCustomAttributes(typeof(AutoCompleteBox), "MinimumPrefixLength", new CategoryAttribute(DesignerProperties.Resources.AutoComplete));
AddCustomAttributes(typeof(AutoCompleteBox), "Text", new CategoryAttribute(DesignerProperties.Resources.CommonProperties));
AddCustomAttributes(typeof(AutoCompleteBox), "TextFilter", new BrowsableAttribute(false));
AddCustomAttributes(typeof(AutoCompleteBox), "ValueMemberBinding", new CategoryAttribute(DesignerProperties.Resources.AutoComplete));
AddCustomAttributes(typeof(AutoCompleteBox), "ValueMemberPath", new CategoryAttribute(DesignerProperties.Resources.AutoComplete));
AddCustomAttributes(typeof(AutoCompleteBox), "Watermark", new CategoryAttribute(DesignerProperties.Resources.AutoComplete));
AddCustomAttributes(typeof(AutoCompleteBox), "Watermark", new DescriptionAttribute("Gets or sets the string that appears in the TextBox when it has no input and does not have focus."));
#else
AddCallback(
typeof(SSWC.AutoCompleteBox),
b =>
{
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.TextFilter),
new BrowsableAttribute(false));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.ItemFilter),
new BrowsableAttribute(false));
b.AddCustomAttributes(
"ValueMemberBinding",
new CategoryAttribute(Properties.Resources.AutoComplete));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.ValueMemberPath),
new CategoryAttribute(Properties.Resources.AutoComplete));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.MaxDropDownHeight),
new CategoryAttribute(Properties.Resources.AutoComplete));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.MinimumPopulateDelay),
new CategoryAttribute(Properties.Resources.AutoComplete));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.MinimumPrefixLength),
new CategoryAttribute(Properties.Resources.AutoComplete));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.IsDropDownOpen),
new CategoryAttribute(Properties.Resources.AutoComplete));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.FilterMode),
new CategoryAttribute(Properties.Resources.CommonProperties));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.Text),
new CategoryAttribute(Properties.Resources.CommonProperties));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.IsTextCompletionEnabled),
new CategoryAttribute(Properties.Resources.CommonProperties));
b.AddCustomAttributes(
Extensions.GetMemberName<SSWC.AutoCompleteBox>(x => x.ItemsSource),
new NewItemTypesAttribute(typeof(string)));
#if MWD40
b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.Controls, true));
b.AddCustomAttributes(
Extensions.GetMemberName<Controls.AutoCompleteBox>(x => x.ItemTemplate),
new DataContextValueSourceAttribute(
Extensions.GetMemberName<Controls.AutoCompleteBox>(x => x.ItemsSource),
true));
b.AddCustomAttributes(
Extensions.GetMemberName<Controls.AutoCompleteBox>(x => x.ValueMemberPath),
new DataContextValueSourceAttribute(
Extensions.GetMemberName<Controls.AutoCompleteBox>(x => x.SelectedItem),
false));
b.AddCustomAttributes(
Extensions.GetMemberName<Controls.AutoCompleteBox>(x => x.SelectedItem),
new DataContextValueSourceAttribute(
Extensions.GetMemberName<Controls.AutoCompleteBox>(x => x.ItemsSource),
true));
b.AddCustomAttributes(
"ValueMemberBinding",
new DataContextValueSourceAttribute(
Extensions.GetMemberName<Controls.AutoCompleteBox>(x => x.SelectedItem),
true));
b.AddCustomAttributes(
Extensions.GetMemberName<Controls.AutoCompleteBox>(x => x.ItemContainerStyle),
new DataContextValueSourceAttribute(
Extensions.GetMemberName<Controls.AutoCompleteBox>(x => x.ItemsSource),
true));
#endif
});
#endif
}
}
}
33 changes: 33 additions & 0 deletions Microsoft.Phone.Controls.Toolkit.Design/ExpanderViewDesign.cs
@@ -0,0 +1,33 @@
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System;
using Microsoft.Windows.Design.Model;

namespace Microsoft.Phone.Controls.Design
{
/// <summary>
/// Initializes the default values for ExpanderView.
/// </summary>
internal class ExpanderViewInitializer : DefaultInitializer
{
/// <summary>
/// Initializes the default values for the ModelItem.
/// </summary>
/// <param name="modelItem">The ModelItem.</param>
public override void InitializeDefaults(ModelItem modelItem)
{
if (modelItem == null)
{
throw new ArgumentNullException("modelItem");
}

#if VISUAL_STUDIO_DESIGNER
modelItem.Properties["Width"].SetValue(456d);
modelItem.Properties["Height"].SetValue(111d);
#endif
}
}
}
44 changes: 44 additions & 0 deletions Microsoft.Phone.Controls.Toolkit.Design/ExpanderViewMetadata.cs
@@ -0,0 +1,44 @@
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System.ComponentModel;
using System.Windows;
using Microsoft.Windows.Design.Features;
using Microsoft.Windows.Design.Metadata;

namespace Microsoft.Phone.Controls.Design
{
internal class ExpanderViewMetadata : AttributeTableBuilder
{
private const string TextProperties = "Text";
private const string OtherProperties = "Other";

public ExpanderViewMetadata()
{
// Type attributes
AddCustomAttributes(typeof(ExpanderView), new DescriptionAttribute("Represents a collection of items that can be expanded and collapsed."));
AddCustomAttributes(typeof(ExpanderView), new FeatureAttribute(typeof(ExpanderViewInitializer)));

// Property attributes
AddCustomAttributes(typeof(ExpanderView), "Expander", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(ExpanderView), "Expander", new DescriptionAttribute("Gets or sets the expander object."));
AddCustomAttributes(typeof(MultiselectItem), "ExpanderTemplate", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(MultiselectItem), "ExpanderTemplate", new DescriptionAttribute("Gets or sets the data template used to display the expander of an ExpanderView."));
AddCustomAttributes(typeof(ExpanderView), "NonExpandableHeader", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(ExpanderView), "NonExpandableHeader", new DescriptionAttribute("Gets or sets the non-expandable header object."));
AddCustomAttributes(typeof(ExpanderView), "NonExpandableHeaderTemplate", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(ExpanderView), "NonExpandableHeaderTemplate", new DescriptionAttribute("Gets or sets the data template used to display the non-expandable header of an ExpanderView."));
AddCustomAttributes(typeof(ExpanderView), "IsExpanded", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(ExpanderView), "IsExpanded", new DescriptionAttribute("Gets or sets whether the ExpanderView is expanded."));
AddCustomAttributes(typeof(ExpanderView), "IsExpanded", new TypeConverterAttribute(typeof(BooleanConverter)));
AddCustomAttributes(typeof(ExpanderView), "HasItems", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(ExpanderView), "HasItems", new DescriptionAttribute("Gets or sets whether the ExpanderView has items."));
AddCustomAttributes(typeof(ExpanderView), "HasItems", new TypeConverterAttribute(typeof(BooleanConverter)));
AddCustomAttributes(typeof(ExpanderView), "IsNonExpandable", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(ExpanderView), "IsNonExpandable", new DescriptionAttribute("Gets or sets whether the ExpanderView is non-expandable."));
AddCustomAttributes(typeof(ExpanderView), "IsNonExpandable", new TypeConverterAttribute(typeof(BooleanConverter)));
}
}
}
16 changes: 16 additions & 0 deletions Microsoft.Phone.Controls.Toolkit.Design/GlobalSuppressions.cs
@@ -0,0 +1,16 @@
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
//
// To add a suppression to this file, right-click the message in the
// Error List, point to "Suppress Message(s)", and click
// "In Project Suppression File".
// You do not need to add suppressions to this file manually.

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Satisfied for Release, not for Debug.")]
33 changes: 33 additions & 0 deletions Microsoft.Phone.Controls.Toolkit.Design/HubTileDesign.cs
@@ -0,0 +1,33 @@
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System;
using Microsoft.Windows.Design.Model;

namespace Microsoft.Phone.Controls.Design
{
/// <summary>
/// Initializes the default values for HubTile.
/// </summary>
internal class HubTileInitializer : DefaultInitializer
{
/// <summary>
/// Initializes the default values for the ModelItem.
/// </summary>
/// <param name="modelItem">The ModelItem.</param>
public override void InitializeDefaults(ModelItem modelItem)
{
if (modelItem == null)
{
throw new ArgumentNullException("modelItem");
}

#if VISUAL_STUDIO_DESIGNER
modelItem.Properties["Width"].SetValue(456d);
modelItem.Properties["Height"].SetValue(111d);
#endif
}
}
}
46 changes: 46 additions & 0 deletions Microsoft.Phone.Controls.Toolkit.Design/HubTileMetadata.cs
@@ -0,0 +1,46 @@
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System.ComponentModel;
using System.Windows;
using Microsoft.Windows.Design.Features;
using Microsoft.Windows.Design.Metadata;

namespace Microsoft.Phone.Controls.Design
{
internal class HubTileMetadata : AttributeTableBuilder
{
private const string TextProperties = "Text";
private const string OtherProperties = "Other";

public HubTileMetadata()
{
// Type attributes
AddCustomAttributes(typeof(HubTile), new DescriptionAttribute("Represents an animated tile that supports an image and a title associated with either a message or a notification."));
AddCustomAttributes(typeof(HubTile), new FeatureAttribute(typeof(HubTileInitializer)));

// Property attributes
AddCustomAttributes(typeof(HubTile), "Source", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(HubTile), "Source", new DescriptionAttribute("Gets or sets the source for the image."));
AddCustomAttributes(typeof(HubTile), "Title", new CategoryAttribute(TextProperties));
AddCustomAttributes(typeof(HubTile), "Title", new DescriptionAttribute("Gets or sets the title associated to the tile."));
AddCustomAttributes(typeof(HubTile), "Title", new TypeConverterAttribute(typeof(StringConverter)));
AddCustomAttributes(typeof(HubTile), "Notification", new CategoryAttribute(TextProperties));
AddCustomAttributes(typeof(HubTile), "Notification", new DescriptionAttribute("Gets or sets the notification displayed on the back of the tile."));
AddCustomAttributes(typeof(HubTile), "Notification", new TypeConverterAttribute(typeof(StringConverter)));
AddCustomAttributes(typeof(HubTile), "Message", new CategoryAttribute(TextProperties));
AddCustomAttributes(typeof(HubTile), "Message", new DescriptionAttribute("Gets or sets the message displayed on the back of the tile."));
AddCustomAttributes(typeof(HubTile), "Message", new TypeConverterAttribute(typeof(StringConverter)));
AddCustomAttributes(typeof(HubTile), "DisplayNotification", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(HubTile), "DisplayNotification", new DescriptionAttribute("Gets or sets whether the notification should be displayed instead of the message."));
AddCustomAttributes(typeof(HubTile), "DisplayNotification", new TypeConverterAttribute(typeof(BooleanConverter)));
AddCustomAttributes(typeof(HubTile), "IsFrozen", new CategoryAttribute(MetadataStore.CommonProperties));
AddCustomAttributes(typeof(HubTile), "IsFrozen", new DescriptionAttribute("Gets or sets whether the HubTile can be animated."));
AddCustomAttributes(typeof(HubTile), "IsFrozen", new TypeConverterAttribute(typeof(BooleanConverter)));
AddCustomAttributes(typeof(HubTile), "GroupTag", new CategoryAttribute(OtherProperties));
AddCustomAttributes(typeof(HubTile), "GroupTag", new DescriptionAttribute("Gets or sets the group of HubTiles that this one is associated with."));
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
50 changes: 50 additions & 0 deletions Microsoft.Phone.Controls.Toolkit.Design/MenuItemDesign.cs
@@ -0,0 +1,50 @@
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System;
using Microsoft.Windows.Design.Model;
using Microsoft.Windows.Design.PropertyEditing;

namespace Microsoft.Phone.Controls.Design
{
/// <summary>
/// Class that implements the DefaultInitializer for MenuItem.
/// </summary>
class MenuItemInitializer : DefaultInitializer
{
/// <summary>
/// Initializes default for the specified ModelItem.
/// </summary>
/// <param name="item">Specified ModelItem.</param>
public override void InitializeDefaults(ModelItem item)
{
if (item == null)
{
throw new ArgumentNullException("item");
}

// Set properties
item.Properties["Header"].SetValue(typeof(MenuItem).Name);
}
}

/// <summary>
/// New item factory for MenuItems.
/// </summary>
class MenuItemFactory : NewItemFactory
{
/// <summary>
/// Creates an instance of the object.
/// </summary>
/// <param name="type">Type.</param>
/// <returns>Instance.</returns>
public override object CreateInstance(Type type)
{
MenuItem item = new MenuItem();
item.Header = typeof(MenuItem).Name;
return item;
}
}
}

0 comments on commit 24f1139

Please sign in to comment.