Click here to Skip to main content
15,911,030 members
Home / Discussions / WPF
   

WPF

 
QuestionAssign names to ModelVisual3D's in code-behind Pin
Etienne_12317-Jun-09 23:54
Etienne_12317-Jun-09 23:54 
AnswerRe: Assign names to ModelVisual3D's in code-behind Pin
#realJSOP18-Jun-09 2:26
professional#realJSOP18-Jun-09 2:26 
GeneralRe: Assign names to ModelVisual3D's in code-behind Pin
Etienne_12318-Jun-09 4:34
Etienne_12318-Jun-09 4:34 
GeneralRe: Assign names to ModelVisual3D's in code-behind Pin
Ray Cassick18-Jun-09 12:43
Ray Cassick18-Jun-09 12:43 
GeneralRe: Assign names to ModelVisual3D's in code-behind Pin
Pete O'Hanlon19-Jun-09 1:00
mvePete O'Hanlon19-Jun-09 1:00 
GeneralRe: Assign names to ModelVisual3D's in code-behind Pin
Etienne_12319-Jun-09 1:32
Etienne_12319-Jun-09 1:32 
GeneralRe: Assign names to ModelVisual3D's in code-behind Pin
Etienne_12321-Jun-09 10:45
Etienne_12321-Jun-09 10:45 
GeneralRe: Assign names to ModelVisual3D's in code-behind Pin
limbique10-Jun-10 8:50
limbique10-Jun-10 8:50 
I can't get it working. I'd like to set/get a name from a dynamically loaded xaml file.
When I save the Viewport3D with this method, the name of the Viewport (specified in xaml) is written, but the name of my model isn't. Anyone has a solution?

using (FileStream stream = new FileStream("text.xaml", FileMode.Create, FileAccess.Write))
{
  XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;
                settings.ConformanceLevel = ConformanceLevel.Auto;
                XmlWriter writer = XmlWriter.Create(stream, settings);
                XamlDesignerSerializationManager manager = new XamlDesignerSerializationManager(writer);
                manager.XamlWriterMode = XamlWriterMode.Expression;
                XamlWriter.Save(Viewport, manager);
            }



-----------------
ModelVisual3D model = new ModelVisual3D();
model.Content = new GeometryModel3D(MeshPrimitives.Box(10, 10, 10), new DiffuseMaterial(new SolidColorBrush(Colors.Red)));
model.Transform = new TranslateTransform3D(new Vector3D(0, 20, 0));
model.SetValue(FrameworkElement.NameProperty, "SomeBox");

Viewport.Children.Add(model);

GeneralRe: Assign names to ModelVisual3D's in code-behind Pin
Etienne_12310-Jun-10 9:46
Etienne_12310-Jun-10 9:46 
AnswerRe: Assign names to ModelVisual3D's in code-behind Pin
Insincere Dave18-Jun-09 16:16
Insincere Dave18-Jun-09 16:16 
QuestionCommands on a button inside a datatemplate in MVVM? PinPopular
Foxandxss17-Jun-09 12:20
Foxandxss17-Jun-09 12:20 
AnswerRe: Commands on a button inside a datatemplate in MVVM? Pin
User 27100918-Jun-09 18:47
User 27100918-Jun-09 18:47 
QuestionMediaElement not playing video on XP 64-bit. Pin
pioner17-Jun-09 9:07
pioner17-Jun-09 9:07 
AnswerRe: MediaElement not playing video on XP 64-bit. Pin
Christian Graus17-Jun-09 11:11
protectorChristian Graus17-Jun-09 11:11 
GeneralRe: MediaElement not playing video on ... Pin
neglewis20-Aug-09 4:32
neglewis20-Aug-09 4:32 
QuestionVb.net 2008 ( visual studio 2008) Pin
Rits11038917-Jun-09 1:04
Rits11038917-Jun-09 1:04 
AnswerRe: Vb.net 2008 ( visual studio 2008) Pin
Christian Graus17-Jun-09 11:06
protectorChristian Graus17-Jun-09 11:06 
QuestionRe: Vb.net 2008 ( visual studio 2008) Pin
Rits11038918-Jun-09 21:45
Rits11038918-Jun-09 21:45 
AnswerRe: Vb.net 2008 ( visual studio 2008) Pin
Christian Graus18-Jun-09 23:55
protectorChristian Graus18-Jun-09 23:55 
AnswerRe: Vb.net 2008 ( visual studio 2008) Pin
Mark Salsbery19-Jun-09 7:28
Mark Salsbery19-Jun-09 7:28 
GeneralRe: Vb.net 2008 ( visual studio 2008) Pin
Rits11038919-Jun-09 18:30
Rits11038919-Jun-09 18:30 
QuestionHow to copy a UI element into another UI Element Pin
Nekkantidivya16-Jun-09 23:35
Nekkantidivya16-Jun-09 23:35 
AnswerRe: How to copy a UI element into another UI Element Pin
ABitSmart17-Jun-09 2:54
ABitSmart17-Jun-09 2:54 
AnswerRe: How to copy a UI element into another UI Element Pin
#realJSOP17-Jun-09 8:09
professional#realJSOP17-Jun-09 8:09 
QuestionWPF TabContol problem Pin
Jacobus0116-Jun-09 22:36
Jacobus0116-Jun-09 22:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.