# ResourceProvider Class

> The ResourceProvider class provides static methods to receive bitmaps or strings from sources that can be accessed via an assigned identifier.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 27.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > ResourceProvider Class
- **3523 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/llms-full.txt

---

### Description

The ResourceProvider class provides static methods to receive bitmaps or strings from sources that can be accessed via an assigned identifier.

### Syntax

```csharp
public class ResourceProvider
```

```vbnet
Public Class ResourceProvider
```

### Examples

The following examples shows how to create a `System.Windows.Controls.Ribbon.RibbonSplitButton` with the appearance of a [ResourceProvider.FileMenuItem.TXITEM\_Print](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/filemenuitem-enumeration/llms-full.txt) button including two drop down items using the ResourceProvider class.

```csharp
private void Window_Loaded(object sender, RoutedEventArgs e) {	
     // Get current Dpi value
     PresentationSource source = PresentationSource.FromVisual(this);
     double dpi = source.CompositionTarget.TransformToDevice.Transform(new Point(96.0, 96.0)).X;

     // Create large print ribbon split button
     RibbonSplitButton printButton = new RibbonSplitButton();
     printButton.LargeImageSource = ResourceProvider.GetLargeIcon(ResourceProvider.FileMenuItem.TXITEM_Print.ToString(), dpi);
     printButton.SmallImageSource = ResourceProvider.GetSmallIcon(ResourceProvider.FileMenuItem.TXITEM_Print.ToString(), dpi);
     printButton.Label = ResourceProvider.GetText(ResourceProvider.FileMenuItem.TXITEM_Print.ToString());
     printButton.KeyTip = ResourceProvider.GetKeyTip(ResourceProvider.FileMenuItem.TXITEM_Print.ToString());

     // Create two drop down buttons
     // 1. A Quick Print button
     RibbonMenuItem printDropDownItem = new RibbonMenuItem();
     printDropDownItem.ImageSource = ResourceProvider.GetSmallIcon(ResourceProvider.FileMenuItem.TXITEM_PrintQuick.ToString(), dpi);
     printDropDownItem.Header = ResourceProvider.GetText(ResourceProvider.FileMenuItem.TXITEM_PrintQuick.ToString());
     printDropDownItem.ToolTipTitle = ResourceProvider.GetToolTipTitle(ResourceProvider.FileMenuItem.TXITEM_PrintQuick.ToString());
     printDropDownItem.ToolTipDescription = ResourceProvider.GetToolTipDescription(ResourceProvider.FileMenuItem.TXITEM_PrintQuick.ToString());
     printButton.Items.Add(printDropDownItem);

     // 2. A Print Preview Button
     printDropDownItem = new RibbonMenuItem();
     printDropDownItem.ImageSource = ResourceProvider.GetSmallIcon(ResourceProvider.FileMenuItem.TXITEM_PrintPreview.ToString(), dpi);
     printDropDownItem.Header = ResourceProvider.GetText(ResourceProvider.FileMenuItem.TXITEM_PrintPreview.ToString());
     printDropDownItem.ToolTipTitle = ResourceProvider.GetToolTipTitle(ResourceProvider.FileMenuItem.TXITEM_PrintPreview.ToString());
     printDropDownItem.ToolTipDescription = ResourceProvider.GetToolTipDescription(ResourceProvider.FileMenuItem.TXITEM_PrintPreview.ToString());
     printButton.Items.Add(printDropDownItem);

     ribbonGroup.Items.Add(printButton);
}
```

```vbnet
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
     ' Get current Dpi value
     Dim source As PresentationSource = PresentationSource.FromVisual(Me)
     Dim dpi As Double = source.CompositionTarget.TransformToDevice.Transform(New Point(96, 96)).X

     ' Create large ribbon split button
     Dim printButton As RibbonSplitButton = New RibbonSplitButton)
     printButton.LargeImageSource = ResourceProvider.GetLargeIcon(ResourceProvider.FileMenuItem.TXITEM_Print.ToString, dpi)
     printButton.SmallImageSource = ResourceProvider.GetSmallIcon(ResourceProvider.FileMenuItem.TXITEM_Print.ToString, dpi)
     printButton.Label = ResourceProvider.GetText(ResourceProvider.FileMenuItem.TXITEM_Print.ToString)
     printButton.KeyTip = ResourceProvider.GetKeyTip(ResourceProvider.FileMenuItem.TXITEM_Print.ToString)

     ' Create two drop down buttons
     ' 1. A Quick Print button
     Dim printDropDownItem As RibbonMenuItem = New RibbonMenuItem
     printDropDownItem.ImageSource = ResourceProvider.GetSmallIcon(ResourceProvider.FileMenuItem.TXITEM_PrintQuick.ToString, dpi)
     printDropDownItem.Header = ResourceProvider.GetText(ResourceProvider.FileMenuItem.TXITEM_PrintQuick.ToString)
     printDropDownItem.ToolTipTitle = ResourceProvider.GetToolTipTitle(ResourceProvider.FileMenuItem.TXITEM_PrintQuick.ToString)
     printDropDownItem.ToolTipDescription = ResourceProvider.GetToolTipDescription(ResourceProvider.FileMenuItem.TXITEM_PrintQuick.ToString)
     printButton.Items.Add(printDropDownItem)

     ' 2. A Print Preview Button
     printDropDownItem = New RibbonMenuItem
     printDropDownItem.ImageSource = ResourceProvider.GetSmallIcon(ResourceProvider.FileMenuItem.TXITEM_PrintPreview.ToString, dpi)
     printDropDownItem.Header = ResourceProvider.GetText(ResourceProvider.FileMenuItem.TXITEM_PrintPreview.ToString)
     printDropDownItem.ToolTipTitle = ResourceProvider.GetToolTipTitle(ResourceProvider.FileMenuItem.TXITEM_PrintPreview.ToString)
     printDropDownItem.ToolTipDescription = ResourceProvider.GetToolTipDescription(ResourceProvider.FileMenuItem.TXITEM_PrintPreview.ToString)
     printButton.Items.Add(printDropDownItem)

     ribbonGroup.Items.Add(printButton)
End Sub
```

The following example includes a Resource Provider object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine(resourceProvider);
Console.WriteLine("Resource Provider is ready for use.");
```

```vbnet
Console.WriteLine(resourceProvider)
Console.WriteLine("Resource Provider is ready for use.")
```

---

## In This Section

- [ResourceProvider.BarcodeItem Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/barcodeitem-enumeration/llms-full.txt): Each BarcodeItem represents a drop-down item inside the RibbonInsertTab's TXITEM_Insert_Barcode drop-down menu. The string conversion of each BarcodeItem can be passed as an identifier to static ResourceProvider methods to receive bitmaps or strings that are associated with the corresponding drop-down item.
- [ResourceProvider.FileMenuItem Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/filemenuitem-enumeration/llms-full.txt): Each FileMenuItem represents the identifier for a file menu item. The string conversion of each FileMenuItem can be passed as an identifier to static ResourceProvider methods to receive bitmaps or strings that are associated with the corresponding file menu item.
- [ResourceProvider.GeneralItem Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/generalitem-enumeration/llms-full.txt): Each GeneralItem represents the identifier for a general item. The string conversion of each GeneralItem can be passed as an identifier to static ResourceProvider methods to receive bitmaps or strings that are associated with the corresponding general item.
- [ResourceProvider.GetKeyTip Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/getkeytip-method/llms-full.txt): Gets the key tip that is associated with an item and specified by the identifier parameter. Such an identifier can be the string conversion of an enumeration that is associated with an item (such as RibbonFormattingTab.RibbonItem.TXITEM_Paste). By default CultureInfo.CurrentUiCulture determines the language of the key tip resources. If no resource translation is provided, that corresponds to the current ui culture or the value of the culture parameter, the returned key tip is based on the English resources.
- [ResourceProvider.GetLargeIcon Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/getlargeicon-method/llms-full.txt): Gets a System.Windows.Media.Imaging.BitmapSource of the large icon that is associated with an item and specified by an identifier or Scalable Vector Graphics (SVG) stream parameter. The identifier can be the string conversion of an enumeration that is associated with an item (such as RibbonFormattingTab.RibbonItem.TXITEM_Paste). The size of the returned large icon depends on the resolution that is specified by the dpi parameter or a specific framework element. The source of the large image is based on a grid of 32x32 Pixel and a resolution of 96 dpi.
- [ResourceProvider.GetSmallIcon Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/getsmallicon-method/llms-full.txt): Gets a System.Windows.Media.Imaging.BitmapSource of the small icon that is associated with an item and specified by an identifier or Scalable Vector Graphics (SVG) stream parameter. The identifier can be the string conversion of an enumeration that is associated with an item (such as RibbonFormattingTab.RibbonItem.TXITEM_Paste). The size of the returned small icon depends on the resolution that is specified by the dpi parameter or a specific framework element. The source of the small image is based on a grid of 16x16 Pixel and a resolution of 96 dpi.
- [ResourceProvider.GetText Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/gettext-method/llms-full.txt): Gets the text that is associated with an item and specified by the identifier parameter. Such an identifier can be the string conversion of an enumeration that is associated with an item (such as RibbonFormattingTab.RibbonItem.TXITEM_Paste). By default CultureInfo.CurrentUiCulture determines the language of the text resources. If no resource translation is provided, that corresponds to the current ui culture or the value of the culture parameter, the returned text is based on the English resources.
- [ResourceProvider.GetToolTipDescription Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/gettooltipdescription-method/llms-full.txt): Gets the tool tip description that is associated with an item and specified by the identifier parameter. Such an identifier can be the string conversion of an enumeration that is associated with an item (such as RibbonFormattingTab.RibbonItem.TXITEM_Paste). By default CultureInfo.CurrentUiCulture determines the language of the tool tip description resources. If no resource translation is provided, that corresponds to the current ui culture or the value of the culture paramter, the returned tool tip description is based on the English resources.
- [ResourceProvider.GetToolTipTitle Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/gettooltiptitle-method/llms-full.txt): Gets the tool tip title that is associated with an item and specified by the identifier parameter. Such an identifier can be the string conversion of an enumeration that is associated with an item (such as RibbonFormattingTab.RibbonItem.TXITEM_Paste). By default CultureInfo.CurrentUiCulture determines the language of the tool tip title. If no resource translation is provided, that corresponds to the current ui culture or the value of the culture paramter, the returned tool tip title is based on the English resources.
- [ResourceProvider.ShapeItem Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/shapeitem-enumeration/llms-full.txt): Each ShapeItem represents a gallery item inside the RibbonInsertTab's TXITEM_InsertShape drop-down menu. The string conversion of each ShapeItem can be passed as an identifier to static ResourceProvider methods to receive bitmaps or strings that are associated with the corresponding gallery item.

---

## Nearby

- **Previous:** [ObjectMiniToolbar.RibbonItem Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/objectminitoolbar/ribbonitem-enumeration/llms-full.txt)
- **Next:** [ResourceProvider.BarcodeItem Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/resourceprovider/barcodeitem-enumeration/llms-full.txt)
