0

I want to change the View Cube labels in the Eyeshot model.

E.g. The user should be able to change the "S" direction to just what pleases the user.

What I have done

In the xaml I have accessed the "FrontRingLabel" and then bind it to "FrontRingUserInput" which should be a char.

<ddes:Viewport.ViewCubeIcon>
<ddes:ViewCubeIcon Lighting="False" ShowRing="True" FrontRingLabel="{Binding FrontRingUserInput}" />
</ddes:Viewport.ViewCubeIcon>

Then I try to set the value which i want to display:

public char FrontRingUserInput
{
   get { return 'south'; }

   set { }

}

The error CS1012 C# Too many characters in character literal

Any ideas, or alternativ solutions in how to set the view cube labels?

Steffen
  • 140
  • 1
  • 5

2 Answers2

0

Well you are saying your property returns char which is of 1 byte but you are actually trying to return a string

public char FrontRingUserInput
{
   get { return 'south'; } // "south" is not 1 byte and thus is not char. So the error

You probably want to change the type of the property to string

public string FrontRingUserInput
{
   get { return "south"; }
Rahul
  • 76,197
  • 13
  • 71
  • 125
0

Thank you Rahul!

I was not aware of that. Chaning it to a string or char of only one letter actually worked!

Alternative solution

However the FrontRingLabel of the View Cube is of type char, and therefore when I enter a string of more then one letter it do not appear. Since I need more then one letter my solution is to remove the ring and change the label of the facades of the cube since they take more then one letter (see [this image])1.

Steffen
  • 140
  • 1
  • 5