Пример #1
0
 /// <summary>
 /// Add an handler for custom resources from the specified frame.
 /// </summary>
 /// <param name="frameName"></param>
 /// <param name="handler"></param>
 public void AddCustomResourceRequestedHandler(string frameName, CustomResourceRequestedEventHandler handler)
 {
     lock (SyncRoot) {
         var frame = GetOrCreateFrame(frameName);
         frame.CustomResourceRequestedHandler += handler;
     }
 }
Пример #2
0
 /// <summary>
 /// Remve the handler for custom resources from the specified frame.
 /// </summary>
 /// <param name="frameName"></param>
 /// <param name="handler"></param>
 public void RemoveCustomResourceRequestedHandler(string frameName, CustomResourceRequestedEventHandler handler)
 {
     // do not create if frame does not exist
     if (Frames.TryGetValue(frameName, out var frame))
     {
         frame.CustomResourceRequestedHandler -= handler;
     }
 }