Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type convertor xaml shortening #1

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

himgoyalmicro
Copy link
Owner

No description provided.

@dipeshmsft
Copy link
Collaborator

Few points before further review :

  1. Converters should be in there own file
  2. Converters are missing CanConvertTo and ConvertTo methods.

@dipeshmsft
Copy link
Collaborator

Is there a possibility to combine the TypeConverters in one ?

@@ -5537,6 +5541,8 @@ private Type InitializeOneType(KnownElements knownElement)
case KnownElements.DateTimeConverter: t = typeof(DateTimeConverter); break;
case KnownElements.DateTimeConverter2: t = typeof(DateTimeConverter2); break;
case KnownElements.UriTypeConverter: t = typeof(UriTypeConverter); break;
case KnownElements.RowDefinitionCollectionConverter: t = _asmFramework.GetType("System.Windows.Controls.RowDefinitionCollectionConverter"); break;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you used this method ? typeof should have worked.

{
if (value is string input)
{
IProvideValueTarget ipvt = context?.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what should we do when string is empty or null ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added please check

}
}

return base.ConvertFrom(context, culture, value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to call this base.ConvertFrom method ? We know that base cannot handle the conversion anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants