Setting a Type property on a custom object in XAML

I have the following converter which needs to know the Enum type to parse. 
public class EnumToStringConverter : IValueConverter
public Type EnumType { get; set; }
public object Convert(object value, Type targetType, object parameter, string language)
public object ConvertBack(object value, Type targetType, object parameter, string language)
Then I declare the type in XAML using the same syntax used for styles.
<UserControl x:Class="MyProject.PreferencesPage"
xmlns="..."
xmlns:converters="using:MyProject.Converters"
xmlns:model="using:MyProject.Model">
<UserControl.Resources>
<converters:EnumToStringConverter x:Key="EnumToStringConverter" EnumType="model:ResultSize" />
</UserControl.Resources>
<!-- ... -->
</UserControl>
I don't get any squiggle lines, but I get a parse error at runtime.
This is the error:
   An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in BingImageSearch.exe but was not handled in user code
   Additional information: Failed to create a 'Windows.UI.Xaml.Interop.TypeName' from the text 'model:ResultSize'. [Line: 14 Position: 82]
IIRC, this syntax was restricted to TargetType properties on styles and templates in WPF and Silverlight, is this still the case?

I just came on here to look for this issue since I ran into the same thing. We absolutely should be able to set a Type-based property in XAML.  We can in WPF and SL.  Please either fix this TypeName error bug or at least provide us with the
x:Type markup extension so that we can pass types directly to dependency properties in XAML with type checking.
Can someone from Microsoft respond to this request?
actiprosoftware.com - Professional WPF, WinRT, Silverlight, and WinForms UI controls and components

Similar Messages

  • Bug: setting ColumnChart type property breaks the chart object.

    PLease confirm if this Is this a bug or maybe ColumnChart
    type property is only applicable as MXML tag attribute?
    Description: Setting the
    type property of
    ColumnChart object other than "
    clustered" breaks the chart object. (i.e: series dissappear)
    Resetting to "clustered" wont restore the series.

    It breaks the chart when series have effects applied,
    otherwise it works fine.

  • How to set integer type property using um:setProperty

    Using WLP 8.1 .
    Can anyone help to set integer type property programmatically.
    i tried <um:setProperty> . but it can send only string or object type
    not Integer.
    tia
    Mahesh

    Thanks
    It worked for me
    Mahesh.
    Gregory Smith <[email protected]> wrote:
    For Numeric properties, I believe you actually need to use a
    java.lang.Long object (which extends java.lang.Object so it should compile):
    <um:setProperty propertySet="..." propertyName="..."
    value="<%=new Long(10)%>" />
    Greg
    Mahesh wrote:
    Using WLP 8.1 .
    Can anyone help to set integer type property programmatically.
    i tried <um:setProperty> . but it can send only string orobject type
    not Integer.
    tia
    Mahesh

  • Setting Chart type property of iSPC chart dynamically doesn't work

    Hi all,
          I am trying to set the chart type property (XBAR, MEDIAN etc..) of iSPC chart dynamically from my html page.
    This is the code that I used.
    var chart_obj = document.iSPCChart.getChartObject();
    chart_obj.setChartType("MEDIAN");
    iSPCChart is my Applet name.
    But the code doesn't seem to work.
    The chart is always of the type that I have set in the iSPC display template.
    Can someone help me in this regard?
    Thanks a lot.
    Regards,
    M.Subathra

    M,
    Even though that method shows up in the script assistant and the docs it really doesn't work. 
    Just swap out the display template for one saved with the desired type:
    document.iSPCChart.setDisplayTemplate("Folder/MedianChart");
    document.iSPCChart.updateChart(true);
    With all of the alarm rules, colors, limits, settings, etc. it is not likely that you will have the same view (display template) that applies to every SPC chart type.
    There is also a predelivered example of an SPC Chart that uses an iframe and an irpt to dynamically pass the chart type (along with other settings) you can reference: http://<servername>/Lighthammer/Samples/SPC/Servers.irpt
    Regards,
    Jeremy Good

  • Unable to set up the default value in custom object 10,related item section

    Hi,
    Please help me out for the below issue
    Custom Object 10 we renamed to Quarterly Broker Review .In Quarterly Broker Review there is a related item section 'Activity'.
    In Quarterly Broker Review ,Activity related Section ,After clicking on The 'New Task' button 'Account Name' field in Quarterly Broker Review(Parent ) should be prefilled in the Activity Section(Related Item Section) in Account Name Field
    'Account Name' field is a Picklist Read Only field.
    Since it is a picklist read only field i couldn't write the expression in the 'Activity' Related section under 'Account Name' field
    you can also help me by reaching at '[email protected]'
    Thanks,
    Srinivas Merugu

    Hi Srinivas,
    As you know, you can refer to a field in a different object by using JoinFieldValue function. But this function is not available for all the object references. If you refer online help for JoinFieldValue function you would notice that from activity only CustomObjects 1,2 an 3 can be referenced using this function.
    If this is possible for the activity and CustomObject 10 then you go to the field named Account Id in Activity object and set a default value. I guess in the parent object "CustomObject10" Account Id will also be stored in "Account: Integration ID". So this field value can be copied into the Account Id field of Activity.
    Instead you could write a web service program to achieve this.
    Thanks
    Naren

  • Set data type property

    Hi all.
    I'm on devsuite 10g.
    Is there a way to set the data type property of an item at runtime???
    Thanks all for the collaboration,
    Fabrizio

    You can't it's a design time only construct

  • Issue with use of collection type attibutes of oracle custom objects in BC4

    Hi There,
    Just see the simulation, it seems to be an issue with BC4J/OC4j when we have an attribute in the view object mapped to a database column that is of type collection of custom oracle objects.
    1-     I have a oracle type Quantity that is defined to contain 2 numbers
    2-     I have a oracle collection QuantityList that is a collection of Quantity objects.
    3-     I have a table defined as :
    CREATE TABLE ANU_TEST_QUANTITYLIST
      ID        NUMBER,
      USR_DATA  QUANTITYLIST
    NESTED TABLE USR_DATA STORE AS ANU_QUANTITYLIST;4-     Now I try to select the id and usr_data column of this table through the VAnuTestQuantityList view.
    5-     It throws the following exception:
    ## Detail 0 ##
    java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)

    I try using the "Business components from tables" wizard to create a new EO, VO, and AM related to the ANU_TEST_QUANTITYLIST and it works fine for me. You'll see that JDeveloper creates you a custom Quantitylist domain object as part of this process.
    If you are making programmatic use of the oracle.sql.STRUCT then you will see this error in three-tier.
    Use the oracle.jbo.domain.Struct instead.

  • I can't set the visible property of a CWAnnotation Object

    I'm working in a W2000 with Visual Basic 6.0.
    When I try to set this property (Visible in CWAnnotation), Visual Basic generates a run time error. Is there any kind of patch?

    This is a known issue with Measurement Studio 6.0. There is not currently a patch for this problem. The workaround is to move the annotation outside the plot area when you do not want to display it.
    David Rohacek
    National Instruments

  • Set Default Value based on Field from another table for a custom object

    I'm trying to set the default value on a custom object field to the value of an account field. I have tried the syntax 50 different ways, and just am getting no where. The account field label displays as DBA, the integration tag is ltDBA_ACCT, and it shows up in reporting fx area as Account.Text_22.
    The custom object field I'm triying to update is also called DBA, which was originally the "NAME" required field. Does the table name, Account, have to be included? Do I need a function in front of the field?
    I have been updating the external ID using the row ID with syntex <ID> (Less than ID greater than) so I know it is possible to set the Default Value, but <DBA>, <ltDBA_ACCT>, "Account"."DBA", and so on just don't not work.
    If anyone knows how to enter this I'd really appreciate the help.

    Ok, so if you want to default a field to the value from another object, you have to use the JoinFieldValue function. I think you understand that, based on your original post, but I want to be sure that you do.
    Next, this will only work as a default if the record is created from the object that you wish to join on because a default works at record creation and the ID needs to be available for it to work properly. It will not work if you choose the related object record after the custom object record is created. You could set the value as a post-default, but that does not seem to meet your requirements.
    The syntax for the Default Value would be as follows: JoinFieldValue(ref_record_type, foreign_key, field_name).
    In your case, ref_record_type is '<Account>', foreign_key is &#91;<AccountId>&#93;, and field_name is '<YourFieldName>'. The best way to determine what the field name is would be to create a new workflow for Account and use the Workflow Rule Condition expression builder to pick your field ("DBA") from the list. The value that is returned by the expression builder should be placed in the field_name variable in the JoinFieldValue function (minus the brackets and in single quotes).
    Give this a shot and let me know how you do.
    Thom

  • Import records to custom object 2

    Hi expert,
    Are we able to import records to the custom objects?
    For some reason, the import record type does not have custom object 2 for selction. Is it a system bug?
    Thanks, Sab.

    Sab, make sure you have access to custom object 2 in your role and access profiles.

  • How to set task type of a task in MS Project using excel vba code.

    Hello Gurus,
    I am generating MS Project files(.mpp) files form excel data. An excel macro in the excel file will read the excel data and will generate the .mpp file. It is working fine. now i want to set the task type of all the tasks to "Fixed work" from excel
    vba code.
    How to use the property PjTaskFixedType in setting the task type??
    refer below links
    http://msdn.microsoft.com/en-us/library/office/ff861713.aspx
    http://msdn.microsoft.com/en-us/library/office/ff864157.aspx
    Can someone help me in setting task type property from excel vba.
    I have attached my sample code used to generate the mpp file. It is not the complete code but you will get an idea from it.
    Set pjApp = CreateObject("MSProject.Application")
    pjApp.FileNew
    Set newproj = pjApp.ActiveProject
    newproj.Tasks.Add (task_name)
    newproj.Tasks(mpp_row_number).Start = task_start_date
    newproj.Tasks(mpp_row_number).Finish = task_end_date
    newproj.Tasks(mpp_row_number).ResourceNames = resource_name
    pjApp.FileSaveAs mpp_file_save_path & mpp_file_name & ".mpp"
    pjApp.FileClose
    pjApp.Quit
    Any help is appreciated.

    Hi Syamku,
    A simple example that sets the task type:
    ActiveProject.Tasks(2).Type = pjFixedDuration
    ActiveProject.Tasks(3).Type = pjFixedUnits
    ActiveProject.Tasks(4).Type = pjFixedWork
    http://msdn.microsoft.com/en-us/library/office/ff860469(v=office.15).aspx
    Hope this helps

  • Delta load of customizing objects from R3 to CRM

    I need to set up a delta load for customizing objects for ex: DNL_CUST_BNKA from R3 to CRM.  Is there any documentation on this subject?  Please advise.  Thanks.

    This is what I got from SAP
    Bank Details information is a customizing object, and is not designed
    for frequent changes, because there's no delta download for customizing
    objects. If you create new Bank/change detail or delete an old one,
    you have to perform initial load manually for DNL_CUST_BNKA again.
    You can also do a request download of the replication object
    'DNL_CUST_BNKA'to get some bank data added later on.
    (Transaction \R3AR2 ).
    You will need to do a request download of bank data from time to time
    whenever you change the bank details. This is currently how it can be
    done in SAP Standard.
    If you change regularly bank master data:
    The data has to be in sync between R/3 and CRM. If you make changes
    often to the bank master data, you might consider scheduling a regular
    job. See below for steps.
    1. Transaction R3AS
    2. Load Object = DNL_CUST_BNKA
    Source Site = your R/3 system
    Destination Site = your CRM system
    3. Menu Goto > Variants > Save Variant
    4. Enter a Variant Name and Description
    5. Start Transaction SM36 to define a background job
    6. Select the Job Wizard button:
    In step Defining a Job Step, select ABAP program step
    In step Define an ABAP Program Job Step, enter ABAP program name
    SMOF_DOWNLOAD and the variant you created in step 4
    7. Click on Job Wizard and follow the steps, choose ABAP Program
    SMOF_DOWNLOAD and the variant you created in step 4
    8. Select start time Immediately
    9. Press Complete to finish
    10.Choose Job Selection (SM37)
    11.Enter the Job Name -> should have status finished
    Schedule the job (SM36 > start condition) according to how often you
    change your bank

  • Tree control w/ custom objects...

    I have a Tree control in which i put custom objects. It works
    well, but now i want to start adding custom icons, or removing the
    icons altogether, for it's nodes. How do i do this? Do i need to
    add some property to my custom object nodes? I appreciate any
    info!

    "peteandrus" <[email protected]> wrote in
    message
    news:glsu6c$pfm$[email protected]..
    >i am mostly concerned, for now, about having no icon. I
    tried passing
    >'null' back from my iconFunction, but it blew up on me.
    Any suggestions
    >about how to go about this? thanks
    try this (pseudocode, not tested)
    //this is a 1 px transparent png
    [Embed ('images/icons/nullIcon.png')]
    private var nullIcon:Class;
    [Embed ('images/icons/yourIcon.png')]
    private var yourIcon:Class;
    private function setIcon(data:Object):Class {
    if (data.something) {
    return yourIcon;
    return nullIcon;
    HTH;
    Amy

  • How can I get the value of a custom property from a resource object?

    I am trying to get the value(s) of a custom property, called "status" within a method. The method has an object of type IResource available to it.
    I have tried the following:
    PropertyName propName = new PropertyName("","status");
    value = res.getProperty(propName).toString();
    However, I am getting a NullPointerException when I try to create the PropertyName instance.
    Is there a better way to get the value of a specific property from a resource object?
    Thanks,
      Tom

    Thanks Praveen.
    I was missing the default namespace of "http://sapportals.com/xmlns/cm" - I thought I could just pass an empty string for the namespace, but it looks like I must always specifiy, even if it is default.
    Tom

  • 11g - LDAP Sync - Select Custom Object class based on user type

    Hi Gurus,
    We have Ldap Sync set up between OIM 11g and ODSEE, we have some custom object class in ODSEE when the user are getting created in OIM it is getting created in ODSEE and it has all object class , every thing is working fine.
    Now we have to select the object class based on user type of OIM, while pushing the user to ODSEE through LDAP sync.
    we checked the LDAPUser.xml we doesnt have any option to choose custom object class based on user type.
    Guys needs suggestion how to go forward on this requirement.

    Do you have OVD between OIM and ODSEE? If yes, then this can be handled at OVD. By modifying the LDAP Adapter and setting up search for users with custom objectclass instead of inetorgperson.
    Flow would be as follows:
    OIM --> LDAPRequest to Create User with inetorgperson to OVD --> OVD --> change request's objectclass to custom objectclass --> Create user in OID with custom objectclass
    ~Yagnesh

Maybe you are looking for