Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating buttons on a tab in .NET 8.0.

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
rhavrys
427 Views, 8 Replies

Creating buttons on a tab in .NET 8.0.

rhavrys
Participant
Participant

Can anyone suggest how to load an icon onto a button in .NET 8.0 if PresentationCore is missing?

0 Likes

Creating buttons on a tab in .NET 8.0.

Can anyone suggest how to load an icon onto a button in .NET 8.0 if PresentationCore is missing?

8 REPLIES 8
Message 2 of 9
jeremy_tammik
in reply to: rhavrys

jeremy_tammik
Autodesk
Autodesk

I would assume that the code is virtually unchanged from the previous .NET Framework. What do you need PresentationCore for?

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

I would assume that the code is virtually unchanged from the previous .NET Framework. What do you need PresentationCore for?

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 9
rhavrys
in reply to: jeremy_tammik

rhavrys
Participant
Participant

PushButton pushButton = CreatePushButton(panel0, typeof(CmdAbout), "About");
pushButton.LargeImage = Converter(Properties.Resources.about_32_32);
pushButton.Image = Converter(Properties.Resources.about_16_16);

For example, LargeImage & Image its presentation core. When I try to set an icon for my buttons, I get an error that PresentationCore is missing. Unfortunately, I couldn't find any answers online on how to do this.

0 Likes

PushButton pushButton = CreatePushButton(panel0, typeof(CmdAbout), "About");
pushButton.LargeImage = Converter(Properties.Resources.about_32_32);
pushButton.Image = Converter(Properties.Resources.about_16_16);

For example, LargeImage & Image its presentation core. When I try to set an icon for my buttons, I get an error that PresentationCore is missing. Unfortunately, I couldn't find any answers online on how to do this.

Message 4 of 9
rhavrys
in reply to: jeremy_tammik

rhavrys
Participant
Participant

Can WPF also be used to create UIs in .NET 8? I heard there were some changes to it as well.

 
0 Likes

Can WPF also be used to create UIs in .NET 8? I heard there were some changes to it as well.

 
Message 5 of 9
jeremy_tammik
in reply to: rhavrys

jeremy_tammik
Autodesk
Autodesk
Accepted solution

Image and LargeImage are Revit API properties on the RibbonButton class:

  

  

They are of type ImageSource:

  

  

You can certainly convert to that in .NET Core as well:

   

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

Image and LargeImage are Revit API properties on the RibbonButton class:

  

  

They are of type ImageSource:

  

  

You can certainly convert to that in .NET Core as well:

   

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 6 of 9
jeremy_tammik
in reply to: rhavrys

jeremy_tammik
Autodesk
Autodesk

Yes, of course, squared.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

Yes, of course, squared.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 7 of 9
rhavrys
in reply to: jeremy_tammik

rhavrys
Participant
Participant

Here what I got(

0 Likes

Here what I got(

Message 8 of 9
rhavrys
in reply to: rhavrys

rhavrys
Participant
Participant

Screenshot_1.png

0 Likes

Screenshot_1.png

Message 9 of 9
jeremy_tammik
in reply to: rhavrys

jeremy_tammik
Autodesk
Autodesk

Here is one of the solutions that I pointed out in my previous answer:

  

https://stackoverflow.com/questions/59831243/using-imagesource-in-net-core-3-1

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes

Here is one of the solutions that I pointed out in my previous answer:

  

https://stackoverflow.com/questions/59831243/using-imagesource-in-net-core-3-1

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report