How do I change the location of a model in WPF ?

Each model has a particular location in the scene. In order to move the model around the scene, rotate the model or to change it’s size, it is not practical to change the vertices of a model like the 2D objects. Instead 3D models have the ‘Transform’ property with which you can move the models, change their sizes or rotate them.

How can I specify a Custom Popup Position ?

You can specify a custom pop-up location by setting the Placement property to Custom. This can be done with the following code snippets. [XAML] <Popup Name=”myCustomPopup” PlacementTarget =”{Binding ElementName=myGridLayout}” Placement=”Custom”> <TextBlock Height=”50″ Width=”150″ Background=”LightGray” TextWrapping=”Wrap”>Custom popup position demo</TextBlock> </Popup> [C#] public CustomPopupPlacement[] placementForPopup(Size popupSize, Size targetSize, Point offset) { CustomPopupPlacement customPlacement1 = new CustomPopupPlacement(new Point(-40, 90), PopupPrimaryAxis.Vertical); CustomPopupPlacement customPlacement2 = new CustomPopupPlacement(new Point(20, 30), PopupPrimaryAxis.Horizontal); CustomPopupPlacement[] customPlacements = new CustomPopupPlacement[] { customPlacement1 , customPlacement2 }; return customPlacements ; } [C#] myCustomPopup.CustomPopupPlacementCallback = new CustomPopupPlacementCallback(placementForPopup); Reference link: https://docs.microsoft.com/en-us/dotnet/framework/wpf/controls/how-to-specify-a-custom-popup-position

How do I support drag-and-drop for a RichTextBox?

You must set the ‘AllowDrop’ property on the RichTextBox control to true and also handle both the ‘DragEnter’ and ‘DragDrop’ events. Add event handlers to the control as given below. [C#] using System.Windows.Forms; richTextBox1.DragEnter += new DragEventHandler( richTextBox1_DragEnter ); richTextBox1.DragDrop += new DragEventHandler( richTextBox1_DragDrop ); Write event handlers : { private void richTextBox1_DragEnter(object sender, DragEventArgs e) { e.Effect = e.Data.GetDataPresent(DataFormats.Text) ? DragDropEffects.Copy : DragDropEffects.None; } private void richTextBox1_DragDrop(object sender, DragEventArgs e) { // Load the file into the control string text = (string)e.Data.GetData(‘Text’); richTextBox1.LoadFile(text, RichTextBoxStreamType.RichText); } public Window1() { InitializeComponent(); } }

How do I detect permission for a file in a partial trust application ?

This situation occurs when an assembly is used by both windows and XBAP application in a partial trust. The assembly might have permission when used through windows application and the same when used through XBAP application will throw a security exception. To prevent this situation, the permission for a file can be checked using the ‘Demand()’ method on the instance of the desired permission. If a file doesn’t have permission, the Demand() method throws a security exception, else it can be used by the partial trust application.

Can I add prerequisites in my ClickOnce deployment ?

Yes. ClickOnce allows you to add prerequisites in ClickOnce deployment. It should download the installer packages for those prerequisites to your development machine. When you publish the ClickOnce application, choose Download prerequisites from the same location as my application. An error will occur if the installer packages aren’t in the Packages folder. Reference link: https://docs.microsoft.com/en-us/visualstudio/deployment/how-to-include-prerequisites-with-a-clickonce-application